admin管理员组文章数量:1024166
I would like to make a Chrome extension that is able to control the Netflix player.
The current Netflix player is written in HTML5 as far as I can tell, so I was wondering if there is a way to control the player, e.g. play, pause, volume control and changing the position of the video.
I've tried using this to control the playing and pausing functions and it works.
document.getElementsByClassName("player-control-button player-play-pause")[0].click();
I've also tried using but then I just get an error saying that videoPlayer()
isn't a function
netflix.cadmium.objects.videoPlayer();
Is there something similar I can do to change the volume and the position of the video?
Thanks!
I would like to make a Chrome extension that is able to control the Netflix player.
The current Netflix player is written in HTML5 as far as I can tell, so I was wondering if there is a way to control the player, e.g. play, pause, volume control and changing the position of the video.
I've tried using this to control the playing and pausing functions and it works.
document.getElementsByClassName("player-control-button player-play-pause")[0].click();
I've also tried using but then I just get an error saying that videoPlayer()
isn't a function
netflix.cadmium.objects.videoPlayer();
Is there something similar I can do to change the volume and the position of the video?
Thanks!
Share Improve this question edited Jun 27, 2018 at 11:25 user7637745 9852 gold badges14 silver badges27 bronze badges asked Nov 20, 2015 at 15:34 user4878556user4878556 1- Netflix offers keyboard shortcuts (helpflix./en/node/24855) for most of the controls you have mentioned. Perhaps you could just fire a keyboard event? stackoverflow./questions/961532/…. The only thing you'll be able to do is seek to a particular time. – luc122c Commented Oct 12, 2017 at 8:39
1 Answer
Reset to default 5First get the <video>
element as variable e.g. by:
media = document.getElementsByTagName("video")[0];
After that you can control the volume. To mute the sound:
media.volume = 0
Turn the volume to 100%:
media.volume = 1
Turn the volume to 60%:
media.volume = 0.6
Start the video:
media.start();
Pause the video:
media.pause();
I would like to make a Chrome extension that is able to control the Netflix player.
The current Netflix player is written in HTML5 as far as I can tell, so I was wondering if there is a way to control the player, e.g. play, pause, volume control and changing the position of the video.
I've tried using this to control the playing and pausing functions and it works.
document.getElementsByClassName("player-control-button player-play-pause")[0].click();
I've also tried using but then I just get an error saying that videoPlayer()
isn't a function
netflix.cadmium.objects.videoPlayer();
Is there something similar I can do to change the volume and the position of the video?
Thanks!
I would like to make a Chrome extension that is able to control the Netflix player.
The current Netflix player is written in HTML5 as far as I can tell, so I was wondering if there is a way to control the player, e.g. play, pause, volume control and changing the position of the video.
I've tried using this to control the playing and pausing functions and it works.
document.getElementsByClassName("player-control-button player-play-pause")[0].click();
I've also tried using but then I just get an error saying that videoPlayer()
isn't a function
netflix.cadmium.objects.videoPlayer();
Is there something similar I can do to change the volume and the position of the video?
Thanks!
Share Improve this question edited Jun 27, 2018 at 11:25 user7637745 9852 gold badges14 silver badges27 bronze badges asked Nov 20, 2015 at 15:34 user4878556user4878556 1- Netflix offers keyboard shortcuts (helpflix./en/node/24855) for most of the controls you have mentioned. Perhaps you could just fire a keyboard event? stackoverflow./questions/961532/…. The only thing you'll be able to do is seek to a particular time. – luc122c Commented Oct 12, 2017 at 8:39
1 Answer
Reset to default 5First get the <video>
element as variable e.g. by:
media = document.getElementsByTagName("video")[0];
After that you can control the volume. To mute the sound:
media.volume = 0
Turn the volume to 100%:
media.volume = 1
Turn the volume to 60%:
media.volume = 0.6
Start the video:
media.start();
Pause the video:
media.pause();
本文标签: htmlControl Netflix player using JavaScriptStack Overflow
版权声明:本文标题:html - Control Netflix player using JavaScript - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745537316a2155020.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论