Chrome中的Netflix视频播放器 - 如何寻求? [英] Netflix video player in Chrome - how to seek?

查看:201
本文介绍了Chrome中的Netflix视频播放器 - 如何寻求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直无法弄清楚如何在Chrome中运行的Netflix视频播放器中进行视频搜索(自动前进到视频中的某个点)。可以读取 currentTime 属性,但不能在Netflix播放器中设置,设置后立即触发错误哎呀!出错了。。其他操作(例如播放暂停)运行良好。例如,您可以尝试以下操作:


  1. 登录Netflix(来自Google Chrome)并转到电影世界末日

  2. 电影加载后,如果开始播放,请暂停播放。

  3. 打开Chrome开发者工具面板。转到控制台选项卡。

  4. 将以下代码段粘贴到控制台中,然后按< ENTER>

var video = document.evaluate('// * [@ id =5670317] / video',document).iterateNext ()



注意:id值特定于Armageddon。如果您选择其他电影,没问题,请根据该电影的网址中的ID更改ID。


  1. 输入以下内容,然后按< Enter> video.play()。观察视频继续播放。

很简单,但如何让视频自动前进到视频中的特定点?您可以参考此文档。显然,您可以通过从左到右拖动视频播放器滑块手动搜索并将其释放到某个位置。您可能希望在执行此操作时发现调用哪个方法或事件,并对其进行模拟。到目前为止,我还没有运气。



任何想法?

解决方案

最后找到了一个简单的解决方案:

  netflix.cadmium.UiEvents.events.resize [1] .scope.events.dragend [1] .handler(null,{value:999,pointerEventData:{playing:false}}); 

您可以设置:




  • 位置使用属性

  • 使用 pointerEventData.playing 属性

  • <播放状态/ ul>


    这不是完整的解决方案,但可能很有用。



    netflix的早期版本玩家使用全局对象 window.netflix.cadmium.objects.videoPlayer 。在最近的版本中,它是空的,但您可以在事件监听器中访问此对象:


    1. 打开Chrome开发者工具

    2. 选择body元素

    3. 选择事件监听器

    4. 打开框架监听器

    5. 选择keydown事件,body - 处理程序p(e),[[Scopes]],1 [[Closure]]

    6. 您可以保存此对象引用上下文菜单 - 存储为全局变量

    7. 然后在新的全局变量中,您可以访问 temp1.cadmium.objects.videoPlayer



      temp1.cadmium.objects.videoPlayer()。getDuration()
      temp1.cadmium.objects.videoPlayer()。seek(2283839);
      temp1.cadmium.objects.videoPlayer()。seek(4283839);


    [![输入这里的图像描述] [1]] [1]



    我不确定是否可以完全自动化。您可以通过

      getEventListeners(document.getElementsByTagName(body)[0])来访问此侦听器.keydown [0 ] .listener 

    但我不知道如何访问范围变量




    I have been unable to figure out how to do a video seek (automatically advance to a certain point in the video) in the Netflix video player running in Chrome. The currentTime property can be read but not set in the Netflix player, and when set, immediately triggers the error "Whoops! Something went wrong.". Other actions such as Play and Pause work quite well. For example, you can try the following:

    1. Log into Netflix (from Google Chrome) and go to the movie Armageddon.
    2. After the movie loads, pause it if it starts playing.
    3. Open the Chrome Developer Tools panel. Go to the Console tab.
    4. Paste the following snippet into the console and hit <ENTER>:

    var video = document.evaluate('//*[@id="5670317"]/video',document).iterateNext()

    Note: The id value is specific to Armageddon. If you choose a different movie, which is fine, change the id as per the id in the URL of that movie.

    1. Enter the following and then press <Enter>: video.play(). Observe that the video resumes playing.

    Simple enough, but how to make the video auto-advance to a specific point in the video? You may want to refer to this doc. Obviously you can manually seek by dragging the video player slider from left to right and release it someplace. You may wish to discover which method or event is called when you do this, and simulate that. I haven't had luck thus far.

    Any ideas?

    解决方案

    Finally found a simple solution:

    netflix.cadmium.UiEvents.events.resize[1].scope.events.dragend[1].handler(null, {value: 999, pointerEventData: {playing: false}});
    

    You can set:

    • position using value property
    • playing state using pointerEventData.playing property

    It's not complete solution, but can be useful.

    Previous version of netflix player was with global object window.netflix.cadmium.objects.videoPlayer. In the recent version it's empty, but you can access this object within events listeners:

    1. Open Chrome Developer Tools
    2. Select "body" element
    3. Select "Event Listeners"
    4. Turn on "Framework listeners"
    5. Select "keydown" event, "body" - handler p(e), "[[Scopes]]", 1 [[Closure]]
    6. You can save this object reference with context menu - "Store as a global variable"
    7. Then in new global variable you can get access to temp1.cadmium.objects.videoPlayer

      temp1.cadmium.objects.videoPlayer().getDuration() temp1.cadmium.objects.videoPlayer().seek(2283839); temp1.cadmium.objects.videoPlayer().seek(4283839);

    [![enter image description here][1]][1]

    I am not sure is it possible to do fully automatic. You can get access to this listeners by

    getEventListeners(document.getElementsByTagName("body")[0]).keydown[0].listener
    

    But I don't know how to get access to scopes variables

    这篇关于Chrome中的Netflix视频播放器 - 如何寻求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆