-
Notifications
You must be signed in to change notification settings - Fork 64
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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'), |
There was a problem hiding this comment.
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)), |
There was a problem hiding this comment.
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
I didn't mean to close the other pull request