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

Videos only play upon second click #1021

Open
mimre25 opened this issue Dec 8, 2024 · 13 comments
Open

Videos only play upon second click #1021

mimre25 opened this issue Dec 8, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@mimre25
Copy link

mimre25 commented Dec 8, 2024

Context

Some context from a previous issue that I had is in #913.
Note that I had a continuous ping from my Raspberry Pi to the router while testing, so I'm pretty sure I'm not losing the internet connection.
I've updated both Kodi and the plugin in hopes that this will solve the issue.

Please provide any relevant information about your setup

  • Add-on Version: 7.1.1.6 (issue was also present on previous versions)
  • Kodi Version: 21.1 (21.1.0) Git:20241025-f41df4d7da (issue was also present on 20.5)
  • Kodi GUI Language: English
  • Operating System: Raspberry Pi OS 64 bit
  • Operating System Language: English

Expected Behavior

Video plays upon select.


Current Behavior

When I'm on my watch later list and I navigate to a video and then click to play it, I'm zapped back to the previous video in the list and nothing is played.
Only the second time I select a video works.


Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Use my kodi setup (lol)
  2. Watch a video on the watch later list.
  3. Once done, select any other video in the list
  4. ---> be zapped back to the position of the video watched in (1.)
  5. Select any other video -> now it plays successfully

Log

Please include a complete debug log.

kodi.log


@mimre25 mimre25 added the bug Something isn't working label Dec 8, 2024
@Rialtho-the-Magnificent

This comment was marked as off-topic.

@demouser007

This comment was marked as off-topic.

@MoojMidge
Copy link
Collaborator

@mimre25 - Reason the playback is failing is because the http server has stopped. When the plugin is run and playback requested, the http server is requested to run and your log shows this happening everytime except when the playback fails. Can you get a debug log? A normal log does not provide enough details to know why the server is not starting.

@Rialtho-the-Magnificent - Sure there is testing done. All works fine for me. If you would like to make sure it works for you there are a few options:

  1. Send me your device and account details and I'll test it for you; or
  2. Test it yourself and provide proper details if you encounter any problems

@demouser007 - thanks :)

@Rialtho-the-Magnificent

This comment was marked as off-topic.

@Rialtho-the-Magnificent

This comment was marked as off-topic.

@demouser007

This comment was marked as off-topic.

@Rialtho-the-Magnificent

This comment was marked as off-topic.

@mimre25
Copy link
Author

mimre25 commented Dec 9, 2024

Here is a debug log.
The issue only occurred after the watching the 2nd video, when I selected the third one that I wanted to watch - but afterwards I've shutdown kodi so that the end of the log file will probably have the related info.

kodi.log

@MoojMidge
Copy link
Collaborator

Here is a debug log.

Thanks. Far more complicated problem than I assumed and not sure it is resolvable.

The httpserver is not the problem, but the plugin code does not even appear to be running because the Python interpreter is busy doing something else.

Does this only happen in your Watch Later list? Does it only happen after you have already watched a video from that list, and then try to watch another one?

@Rialtho-the-Magnificent - I don't really understand what the issue you are having is, but it is unrelated to this issue. Rather than complaining about it there are simple things that can be done:

  1. Run the Setup Wizard in the addon and complete thr steps to setup the addon appropriately for your specific device
  2. If you are still having a problem open a new issue and post a debug log

It's the number of items displayed after the named playlists. These numbers are not being updated when the playlist is modified, i.e. added to or removed from. Looks like the number was only added the first time I installed the specific version (7.1.1.1).

This is because the numbers are part of the playlist details that are cached. Is this your own playlist that you are modifying? How frequently is the playlist being updated?

@Rialtho-the-Magnificent

This comment was marked as off-topic.

@mimre25
Copy link
Author

mimre25 commented Dec 10, 2024

Thanks. Far more complicated problem than I assumed and not sure it is

😬

On the bright side, I'm a dev myself and have been using python for about 10 years now, so I'm happy to help out digging into this. 🙂

Does this only happen in your Watch Later list? Does it only happen after you have already watched a video from that list, and then try to watch another one?

It only happens after watching a video, never from a fresh start.
I believe it also happens in other lists (eg my subscriptions), but I'm not 100% sure, I basically only use the watch later list.

The httpserver is not the problem, but the plugin code does not even appear to be running because the Python interpreter is busy doing something else.

I have another plugin (https://github.com/siku2/script.service.sponsorblock), which recently (a few months ago) has started to sometimes fail to block sponsor segments for me, and upon inspecting the logs it seems like it errors a lot.
So it could be related to that.

I will have more time tomorrow to test a bit more (eg trying other lists, doing another debug log, disabling the sponsorblock plugin,...) and see what comes out of that.

@MoojMidge
Copy link
Collaborator

@Rialtho-the-Magnificent - nothing you are talking about is related to this issue. I have created a new issue for you (#1024), please only respond there.

@mimre25 - it is a timing issue which makes it difficult to replicate, but I know what is happening. Just haven't thought of a clean way to fix it.

Basically there is a Kodi bug where multiple busy dialogs will cause Kodi to terminate. These busy dialogs can occur when making network requests or updating plugin listings (amongst other things), both of which occur when watching items from a playlist. To avoid the crash, the addon

  1. intercepts plugin calls to itself
  2. runs them in the background
  3. caches the result
  4. then opens a new window with the cache result once the other plugin calls have finished

When you are trying to playing a second video it is happening between steps 3 and 4, so rather than playing the video, the plugin call instead continues on with step 4.

I'm pretty sure if you just wait for your device to catchup after playing a video, before playing another video, the problem won't occur.

In the meantime, you can try https://github.com/MoojMidge/plugin.video.youtube/archive/refs/heads/master.zip

It likely won't fix the problem, but takes steps towards a solution.

@Rialtho-the-Magnificent

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants