Move one frame with keys - #158
Conversation
user234683
left a comment
There was a problem hiding this comment.
If you want to get the fps from the data youtube-local has, it will be a little complicated. In javascript there is a data variable on the watch page that contains various useful information. It comes from the js_data template input in get_watch_page in watch.py. However, you will want to add to it a variable to indicate the initial source. The variables that determine the initial source can be found in the area of watch.html that generates the quality selector. These variables are also provided in watch.py, so you can use them to insert the field you need in js_data. Then you will want to add some stuff to the changeQuality function in watch.py to update this.
The alternative would be to find some api that retrieves the framerate from the video
| <script src="/youtube.com/static/js/watch.js"></script> | ||
| <script> | ||
| var video = document.querySelector('video.video'), | ||
| fps_selector = document.querySelector('#quality-select'), |
There was a problem hiding this comment.
This element isn't available when Plyr is being used
| <script> | ||
| var video = document.querySelector('video.video'), | ||
| fps_selector = document.querySelector('#quality-select'), | ||
| fps_int = parseInt(fps_selector.options[fps_selector.selectedIndex].text.split("p")[1].slice(0,2)), |
There was a problem hiding this comment.
Preferable to get this information from the javascript, not by reading from html text on the page, as this string may change. Also, this will error out if it fails to get the fps. The fps could be missing due to YouTube not providing it

I didn't mean to close the other pull request