Skip to content

Move one frame with keys - #158

Open
senchpimy wants to merge 5 commits into
user234683:masterfrom
senchpimy:master
Open

Move one frame with keys#158
senchpimy wants to merge 5 commits into
user234683:masterfrom
senchpimy:master

Conversation

@senchpimy

Copy link
Copy Markdown
Contributor

I didn't mean to close the other pull request

@senchpimy

Copy link
Copy Markdown
Contributor Author

I'm a little messy with the commits

@user234683 user234683 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'),

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)),

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants