-
-
Notifications
You must be signed in to change notification settings - Fork 561
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
Fixed Issue #1508 #1585
Fixed Issue #1508 #1585
Conversation
thanks! @MohamedLebda
doesnt seem to cause an ethernal loop 🤔
what if we removed this?
https://stackoverflow.com/questions/37706626/yt-getplayerstate-not-a-function #1456 :
|
it will because then ImprovedTube.allow_autoplay will always still be false because will always stay ImprovedTube.video_url !== location.href if "yt-navigate-finish" didn't work.
that will cause the video to freeze (always in pause if (auto_play is off) because the ImprovedTube.allow_autoplay will forever be false |
only if the user is active already while before autoplay
i meant, please try to understand, what is the disanvantage when removing the |
sorry I thought you meant this.
if we removed the first line which is var video = ImprovedTube.elements.player; if (ImprovedTube.allow_autoplay === false && video.classList.contains('ad-showing') === false && and if we removed the next 4 lines in
that will result in( auto play off will not work when open a new video because the value of ImprovedTube.allow_autoplay will be true form when we opened a new video |
as we can see here when we choose autoplay off and playlist auto plays off the pause of the video become dependent on ImprovedTube.allow_autoplay once it equals false it stops the video and only plays again if the value of ImprovedTube.allow_autoplay changes to true and that happens, when we start the video again the reason it becomes false, is when the ImprovedTube.video_url !== location. href but in ImprovedTube.initPlayer in function.js the ImprovedTube.video_url = location.href and that function fires when the event listener of yt-navigate-finish' fire but
The "yt-navigate-finish" event listener in the YouTube website's scripts will not work in the following situations:
When the YouTube website is not loaded: If the user is not currently on the YouTube website, the event listener will not be triggered.
When the page does not finish loading: If there is an error or some other issue that prevents the page from fully loading, the "yt-navigate-finish" event will not be triggered.
When the listener is not properly registered: If the event listener is not registered correctly or is removed before the page finishes loading, it will not be triggered.
When the listener conflicts with other scripts: If there are other scripts running on the page that conflict with the "yt-navigate-finish" event listener, it may not be triggered.
When the page is dynamically updated: If the page is dynamically updated using AJAX or other similar techniques, the "yt-navigate-finish" event may not be triggered as it only listens for full page loads.
In general, the "yt-navigate-finish" event listener is reliable and should work in most situations where a user navigates to a new page or video on the YouTube website. However, it is important to keep in mind the limitations listed above and to test your code thoroughly to ensure that it works as expected.
which means that in those cases ImprovedTube.video_url will never equal location.href so it causes the bug of constant pause (freeze)