Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move one frame with keys #158

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

senchpimy
Copy link
Contributor

I didn't mean to close the other pull request

@senchpimy
Copy link
Contributor Author

I'm a little messy with the commits

Copy link
Owner

@user234683 user234683 left a comment

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

@@ -678,6 +678,23 @@ <h2 class="title">{{ title }}</h2>

<script src="/youtube.com/static/js/av-merge.js"></script>
<script src="/youtube.com/static/js/watch.js"></script>
<script>
var video = document.querySelector('video.video'),
fps_selector = document.querySelector('#quality-select'),
Copy link
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
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.

None yet

2 participants