我正在研究一个个人YouTube视频播放器项目,并且正在研究Cookpete的React-player。这是我引用的文件的链接:。
这也是实际玩家: https://cookpete.com/reaect-player/ 。
我正在尝试弄清楚如何在页面上渲染播放率。 cookpete包括三个按钮(1倍,1.5倍,2倍),它们会更改显示的播放率,但是如果您使用YouTube链接作为URL,并使用内置的YouTube栏更改速度,则速度呈现不会改变。
是否可以在页面上使用内置栏更新页面上的当前播放率?我相信YouTube Iframe API(player.getPlayBackrate())中有功能,但是由于我不使用iframe,我将如何集成此功能(也许是event.target.getplaybackrate())?我还看到了有关React Refs的一些事情,但不确定我在这里如何使用。
谢谢你的宝贵时间。我是React/API呼叫的新手,因此对任何帮助都非常感谢。
I am working on a personal YouTube video player project and am looking at cookpete's react-player. Here is the link to the file I am referencing: https://github.com/cookpete/react-player/blob/master/src/demo/App.js.
Here's the actual player as well: https://cookpete.com/react-player/.
I'm trying to figure out how to render the playback rate on the page. cookpete's includes three buttons (1x, 1.5x, 2x) that changes the playback rate displayed, but if you use a YouTube link as the URL and change the speed with the built-in YouTube bar, the speed rendered doesn't change.
Would it be possible to render the current playback rate on the page that updates with the built-in bar? I believe there a function in the YouTube iFrame API (player.getPlaybackRate()), but since I am not using iFrame, how would I integrate this (maybe event.target.getPlaybackRate())? I've also seen some things about React refs but not sure how I'd use here.
Thank you for your time. I am new to React/API calls, so any help is greatly appreciated.
发布评论