node-mpv 超级厉害的播放器,兼容所有格式,速度超快

福尔摩斯对我笑 2019-05-20 6543 次 488条

mpv是一个基于MPlayer和mplayer2的媒体播放器。它支持各种视频文件格式,音频和视频编解码器以及字幕类型。特殊输入URL类型可用于从磁盘文件以外的各种源读取输入。根据平台,支持各种不同的视频和音频输出方法。

使用node调用

  • 安装node-mpv
  • 代码
    let mpv = require('node-mpv');
    let mpvPlayer = new mpv({
    "verbose": true,
    // "audio_only": true, //仅播放声音
    "binary": "mpv-x86_64/mpv.exe"
    },
    [
    "--fullscreen",
    "--fps=60"
    ]);
    mpvPlayer.load("58.mp4")
    

binary为你的exe路径,去官网下载就可以使用

  • 循环播放
    play(arr)
    function play(arr){
    mpvPlayer.load("")
    for(let i = 0; i< arr.length; i++){
    mpvPlayer.append(arr[i]);
    }
    }
    mpvPlayer.on('stopped', function() {
    play(arr)
    });
    
  • 利用第三方平台播放,比如electron
    
    let mpvPlayer = new mpv({
    "binary": path.join(__dirname, "mpv-x86_64/mpv.exe")
    },
    [
    "--wid=" + playerHWND  //electron的实例
    ]);
    
    
  • 相关资料

    https://mpv.io/ https://github.com/00SteinsGate00/Node-MPV

标签: 无

非特殊说明,本博所有文章均为博主原创。

头像也是LOGO
未来博客 博主大人
到了这个年纪,不应该再彷徨!

发表评论



 


已有 488 条评论 1


  1. Stephanie Rothery

    There are certainly a great deal of information like that to take into account. That is an excellent indicate raise. I supply the ideas above as general ideas however plainly there are concerns like the one you bring up where the most essential thing will be working in truthful good faith. I don?t understand if ideal methods have emerged around things like that, but I make certain that your work is clearly determined as a level playing field. Both children and also girls feel the effect of just a moment?s enjoyment, for the rest of their lives.

    回复 2020年4月23日
  2. CBD gummies

    Undeniably imagine that that you said. Your favourite reason appeared to be at the web the simplest
    factor to be aware of. I say to you, I certainly get irked even as
    folks consider concerns that they plainly don’t understand about.
    You controlled to hit the nail upon the highest and
    outlined out the whole thing without having side effect , people could
    take a signal. Will probably be again to get more.
    Thank you

    回复 2020年4月23日
  3. Beau Zourkos

    very wonderful article, i absolutely love this internet site, continue it

    回复 2020年4月22日
  4. dispensaries near me

    Thank you very much

    回复 2020年4月21日
  5. Supplies On The Fly

    코인카지노[…]just beneath, are many absolutely not associated web-sites to ours, even so, they may be surely worth going over[…]

    回复 2020年4月21日
  6. best CBD oil for pain

    We are a bunch of volunteers and starting a new scheme in our community.
    Your site offered us with useful information to work on. You’ve performed
    a formidable task and our whole community will likely be grateful to you.

    回复 2020年4月20日
  7. female viagra pills

    female viagra pills generic viagra 100mg [url=https://viatribuy.com/#]viagra samples[/url] https://viatribuy.com/

    回复 2020年4月20日
  8. buy cialis online without a prescription

    normally particular [url=http://www.cialisles.com/#]buy
    cialis online without a prescription[/url] aside match forth stock tadalafil 20mg lowest price
    bright vegetable buy cialis online without a prescription possibly quality http://cialisles.com/

    回复 2020年4月20日
  9. best cbd cream for pain

    I’ll right away take hold of your rss as I can not find
    your email subscription link or newsletter service. Do you’ve any?

    Please allow me recognise in order that I may subscribe.
    Thanks.

    回复 2020年4月19日
  10. best cbd cream for pain

    What’s up colleagues, its impressive article
    on the topic of teachingand completely explained, keep it up all
    the time.

    回复 2020年4月19日
  11. click resources

    I just want to mention I am just beginner to blogging and truly liked you’re blog site. More than likely I’m planning to bookmark your blog post . You absolutely come with very good articles. Thank you for revealing your web-site.

    回复 2020年4月18日
  12. best CBD pills

    Hey! This post couldn’t be written any better!

    Reading through this post reminds me of my old room mate!
    He always kept chatting about this. I will forward this post to him.
    Fairly certain he will have a good read. Thanks for sharing!

    回复 2020年4月17日
  13. CBD capsules

    Hi it’s me, I am also visiting this website daily, this website is
    truly nice and the users are really sharing nice thoughts.

    回复 2020年4月17日
  14. CBD gummies

    Sweet blog! I found it while browsing on Yahoo News.

    Do you have any tips on how to get listed in Yahoo News?
    I’ve been trying for a while but I never seem to get there!
    Cheers

    回复 2020年4月16日
  15. best CBD oil

    Heya great website! Does running a blog such as this take
    a great deal of work? I’ve virtually no understanding of coding however I had been hoping to start my own blog in the near future.
    Anyways, if you have any recommendations or techniques for new blog owners please
    share. I know this is off topic but I simply had to ask.
    Thanks a lot!

    回复 2020年4月16日
  16. viagra suppliers

    gnc viagra alternative [url=https://viagenupi.com/#]viagra suppliers[/url] buy viagra now viagra suppliers
    viagra 100mg street price https://viagenupi.com/

    回复 2020年4月16日
  17. best CBD gummies

    Oh my goodness! Incredible article dude! Thank you, However I am encountering issues with your RSS.
    I don’t understand the reason why I cannot subscribe to it.
    Is there anyone else getting the same RSS problems?
    Anybody who knows the solution will you kindly respond?
    Thanks!!

    回复 2020年4月15日
  18. dispensary near me

    Great beat ! I would like to apprentice while you amend your website, how could i subscribe for a blog web site? The account helped me a acceptable deal. I had been tiny bit acquainted of this your broadcast provided bright clear concept|

    回复 2020年4月15日
  19. dispensaries near me

    You actually make it seem so easy with your presentation but I find this matter to be actually something that I think I would never understand. It seems too complicated and extremely broad for me. I am looking forward for your next post, I will try to get the hang of it!|

    回复 2020年4月15日
  20. best Royal CBD oil

    I simply could not depart your web site prior to
    suggesting that I really enjoyed the standard information a person provide to your visitors?

    Is gonna be back often to check up on new posts

    回复 2020年4月13日
  21. CBD oil 2500mg

    I’m not that much of a online reader to be honest but your blogs really nice, keep it up!

    I’ll go ahead and bookmark your site to come back later on. Many
    thanks

    回复 2020年4月13日
  22. CBD oil 2500mg

    If some one desires to be updated with most recent technologies then he must be go
    to see this website and be up to date every day.

    回复 2020年4月12日
  23. carte prepagate

    Hello, yes this post is really pleasant and I have learned lot of
    things from it regarding blogging. thanks.

    回复 2020年4月11日
  24. best CBD oil

    Terrific post however I was wanting to know if you could write a litte more on this subject?
    I’d be very thankful if you could elaborate a little bit
    further. Appreciate it!

    回复 2020年4月8日
  25. tadalafil 5mg

    tadalafil 5mg http://genericalis.com/

    回复 2020年4月7日
  26. 바카라 타이

    Today, while I was at work, my sister stole my apple ipad and tested to
    see if it can survive a 30 foot drop, just so she can be a youtube
    sensation. My apple ipad is now broken and she has 83 views.
    I know this is completely off topic but I had to share it with someone!

    回复 2020年4月5日
  27. pkv Games Terbaik

    Great post. I was checking constantly this weblog and I’m inspired!
    Very useful information particularly the ultimate section 🙂
    I deal with such information a lot. I used to be looking for this
    particular information for a very long time. Thank you and best of luck.

    回复 2020年4月5日
  28. event spaces northeast

    At this time it sounds like Expression Engine is the preferred blogging platform available right now.
    (from what I’ve read) Is that what you are using on your blog?

    回复 2020年3月7日
  29. bird deterrent products

    I quite like looking through an article that will make
    men and women think. Also, many thanks for allowing for me to comment!

    回复 2020年2月16日
  30. ig

    It’s awesome designed for me to have a web site, which
    is valuable in support of my know-how. thanks admin

    回复 2020年2月14日
  31. Grace

    For the reason that the admin of this site is working, no question very rapidly it will be well-known, due to its feature
    contents.

    回复 2020年2月12日
  32. efftlab.ru

    Thank you for the good writeup. It in fact was a amusement account it.

    Look advanced to far added agreeable from you! By the way,
    how can we communicate?

    回复 2020年2月11日
  33. www.creatiblogs.es

    What’s up every one, here every person is sharing such knowledge, so
    it’s good to read this blog, and I used to pay a quick visit this weblog
    every day.

    回复 2020年2月9日
  34. http://www.gooptic.com

    Hello there! Would you mind if I share your blog with my facebook group?

    There’s a lot of people that I think would really enjoy your content.

    Please let me know. Cheers

    回复 2020年2月8日
  35. magazin01.ru

    I am no longer certain where you are getting your info, but good topic.
    I needs to spend a while finding out more or understanding more.
    Thank you for fantastic info I was searching for
    this information for my mission.

    回复 2020年2月8日
  36. http://www.yudian.cc/link.php?url=https://vimeo.com/brookwoodcamps

    I know this if off topic but I’m looking into starting my own weblog and was curious what all is needed to get set up?
    I’m assuming having a blog like yours would cost a pretty penny?
    I’m not very web smart so I’m not 100% sure. Any recommendations or advice would be greatly appreciated.

    Thank you

    回复 2020年2月7日
  37. Novella

    This is my first time pay a visit at here and i am actually happy
    to read everthing at one place.

    回复 2020年2月4日