html - Control Netflix player using JavaScript - Stack Overflow

I would like to make a Chrome extension that is able to control the Netflix player. The current Netflix

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
Add a ment  | 

1 Answer 1

Reset to default 5

First 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();

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745537317a4631965.html

相关推荐

  • html - Control Netflix player using JavaScript - Stack Overflow

    I would like to make a Chrome extension that is able to control the Netflix player. The current Netflix

    1天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信