garbear / xbmc

XBMC Main Repository
http://xbmc.org
Other
132 stars 53 forks source link

Attempting to play YouTube video results in error #90

Closed zach-morris closed 5 years ago

zach-morris commented 6 years ago

Version tested: RetroPlayer 18 alpha1 2018-02-11

To Recreate: Attempt to play youtube video in youtube addon. Error window pops up stating 'Failed to Play Game'

Video URL in the log below was truncated for brevity, but the error occurs regardless of the video you choose.

21:41:34.115 T:123145303453696   DEBUG: CAddonSettings[plugin.video.youtube]: loading setting definitions
21:41:34.115 T:123145303453696   DEBUG: CAddonSettings[plugin.video.youtube]: trying to load setting definitions from old format...
21:41:34.117 T:123145303453696   DEBUG: CAddonSettings[plugin.video.youtube]: loading setting values
21:41:34.118 T:123145303453696   DEBUG: [plugin.video.youtube] Selecting YouTube config "All"
21:41:34.118 T:123145303453696   DEBUG: [plugin.video.youtube] User is not logged in
21:41:34.119 T:123145303453696   DEBUG: [plugin.video.youtube] No data for video 'UXZcY6vrceI' cached
21:41:34.120 T:123145303453696   DEBUG: [plugin.video.youtube] [data] v3 request: |GET| path: |videos| params: |{'part': 'snippet,contentDetails', 'id': u'UXZcY6vrceI'}| post_data: |None|
21:41:36.044 T:140735305183232   DEBUG: CCurlFile::GetMimeType - https://xxx -> video/mp4
21:41:36.048 T:123145309356032   DEBUG: Thread GUIDialogCache 123145309356032 terminating (autodelete)
21:41:36.052 T:140735305183232   DEBUG: CPlayerCoreFactory::GetPlayers(https://xxx)
21:41:36.052 T:140735305183232   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: system rules
21:41:36.052 T:140735305183232   DEBUG: CPlayerSelectionRule::GetPlayers: matches rule: system rules
21:41:36.052 T:140735305183232   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: mms/udp
21:41:36.052 T:140735305183232   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: lastfm/shout
21:41:36.052 T:140735305183232   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtmp
21:41:36.053 T:140735305183232   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtsp
21:41:36.053 T:140735305183232   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: streams
21:41:36.053 T:140735305183232   DEBUG: CPlayerSelectionRule::GetPlayers: matches rule: streams
21:41:36.053 T:140735305183232   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: aacp/sdp
21:41:36.053 T:140735305183232   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: mp2
21:41:36.054 T:140735305183232   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvd
21:41:36.054 T:140735305183232   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: sdp/asf
21:41:36.054 T:140735305183232   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: nsv
21:41:36.054 T:140735305183232   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: radio
21:41:36.054 T:140735305183232   DEBUG: CPlayerCoreFactory::GetPlayers: matched {0} rules with players
21:41:36.054 T:140735305183232   DEBUG: CPlayerCoreFactory::GetPlayers: adding videodefaultplayer (VideoPlayer)
21:41:36.054 T:140735305183232   DEBUG: CPlayerCoreFactory::GetPlayers: for video=1, audio=0
21:41:36.054 T:140735305183232   DEBUG: CPlayerCoreFactory::GetPlayers: for video=1, audio=1
21:41:36.055 T:140735305183232   DEBUG: CPlayerCoreFactory::GetPlayers: added {0} players
21:41:38.331 T:140735305183232   DEBUG: ------ Window Deinit (DialogConfirm.xml) ------
21:41:38.342 T:140735305183232    INFO: RetroPlayer: No compatible game client selected, aborting playback
garbear commented 6 years ago

Without seeing the preceding log lines, it looks like RetroPlayer was already active, so even though it chose VP, PR got the play command. I ran into this problem in reverse, when YouTube videos were playing I couldn't launch a game. Is this the case for your issue? I'll look into it, and possibly hack in a fix, but we may be limited by Kodi's architecture.

zach-morris commented 6 years ago

I can recreate it by turning on autoplay trailers in IARL. After launching a game, then exiting it, then browsing for others, and autoplay for a youtube URL is called, it looks like this error can be triggered. It's not 100% though, and I can't fully grasp how to reliably make it happen.

Maybe this can be fixed on the addon side? Is there a way to tell xbmc.Player().play() which playercore to try without looking at all the rules?

zach-morris commented 6 years ago

I think I was able to fix this on my end by adding xbmc.Player().stop() in front of everywhere there's a xbmc.Player().play()