2022-09-09, 14:40
I've been experimenting with an auto-play function for trailers.
Currently I have it in a hidden button that's delayed for three seconds using an animation. It works with the following onfocus line:
I thought it might be more elegant to achieve this with the following skin timer so I'm not relying on a hidden button which causes warnings in the log and the effect is not reliant on the list being focused.
But this is resulting in a playback error. I thought it might be because ListItem.Trailer couldn't be passed to the skin timer, but if I substitute the onstart line for the following, it appears to be able to display the trailer path just fine:
The error I get looks like this. I've tried with $INFO and $ESCINFO
Full log here: https://pastebin.com/gPsAKfHD
Anyone have any ideas why this isn't working?
Currently I have it in a hidden button that's delayed for three seconds using an animation. It works with the following onfocus line:
xml:
<onfocus>PlayMedia($INFO[ListItem.Trailer],1,noresume)</onfocus>
I thought it might be more elegant to achieve this with the following skin timer so I'm not relying on a hidden button which causes warnings in the log and the effect is not reliant on the list being focused.
xml:
<timer>
<name>trailer_autoplay_idle_timer</name>
<start reset="true">System.IdleTime(3) + Window.IsVisible(videos) + !Player.HasMedia + !String.IsEmpty(ListItem.Trailer)</start>
<onstart>PlayMedia($INFO[ListItem.Trailer],1,noresume)</onstart>
<stop>Player.HasMedia</stop>
</timer>
But this is resulting in a playback error. I thought it might be because ListItem.Trailer couldn't be passed to the skin timer, but if I substitute the onstart line for the following, it appears to be able to display the trailer path just fine:
xml:
<onstart>Notification(This shows the trailer path fine, $INFO[ListItem.Trailer],4000)</onstart>
The error I get looks like this. I've tried with $INFO and $ESCINFO
xml:
2022-09-09 13:35:49.479 T:10720 INFO <general>: VideoPlayer::OpenFile: $ESCINFO[ListItem.Trailer]
2022-09-09 13:35:49.495 T:9316 ERROR <general>: CApplication::OnApplicationMessage: Unhandled threadmessage sent, 1073741855
2022-09-09 13:35:51.481 T:10720 ERROR <general>: CRenderManager:reInit - timed out waiting for renderer to preinit
2022-09-09 13:35:51.481 T:15992 DEBUG <general>: Thread VideoPlayer start, auto delete: false
2022-09-09 13:35:51.481 T:10720 DEBUG <general>: CApplicationPlayerCallback::OnPlayBackStarted: CApplication::OnPlayBackStarted
2022-09-09 13:35:51.482 T:15992 INFO <general>: Creating InputStream
2022-09-09 13:35:51.482 T:10720 DEBUG <general>: CAddonDatabase: SELECT repo.id FROM repo .. took 0 ms
2022-09-09 13:35:51.484 T:7868 DEBUG <general>: Loading settings for $ESCINFO[ListItem.Trailer]
2022-09-09 13:35:51.488 T:10720 DEBUG <general>: CAddonDatabase: query SELECT addons.*, repo.addonID AS repoID FROM addons JOIN addonlinkrepo ON addons.id=addonlinkrepo.idAddon JOIN repo ON repo.id=addonlinkrepo.idRepo WHERE addonlinkrepo.idRepo IN (1,2,3) ORDER BY repo.addonID, addons.addonID returned 955 rows in 5 ms
2022-09-09 13:35:51.536 T:10720 DEBUG <general>: CAddonDatabase::GetAddons took 53 ms
2022-09-09 13:35:51.541 T:10720 DEBUG <general>: ADDONS: repository.castagnait - 3 addon(s) loaded
2022-09-09 13:35:51.541 T:10720 DEBUG <general>: ADDONS: repository.jurialmunkey - 15 addon(s) loaded
2022-09-09 13:35:51.541 T:10720 DEBUG <general>: ADDONS: repository.xbmc.org - 928 addon(s) loaded
2022-09-09 13:35:51.549 T:15992 ERROR <general>: CVideoPlayer::OpenInputStream - error opening [$ESCINFO[ListItem.Trailer]]
2022-09-09 13:35:51.549 T:15992 INFO <general>: CVideoPlayer::OnExit()
2022-09-09 13:35:51.549 T:15992 DEBUG <general>: Thread VideoPlayer 15992 terminating
2022-09-09 13:35:51.551 T:8032 DEBUG <general>: CApplicationPlayerCallback::OnPlayBackStopped: CApplication::OnPlayBackStopped
Full log here: https://pastebin.com/gPsAKfHD
Anyone have any ideas why this isn't working?