2019-09-03, 01:32
I have a very basic skin that I have been working on and right now I am finishing up my DialogVideoInfo.xml, which is the movie/tv show information screen. I created two buttons, one to play the video from the beginning, and the other to resume the video from where it left off. Just FYI I don't want that little popup window asking if you want to resume coming up, I want this decision to me made within my skin itself.
The idea is I am using conditional visibility to hide or show certain buttons. So in the end if it's a video that cannot be resumed, it will simply have a play button. If it can be resumed, you will see two buttons, one for start over and the other for resume.
As of right now these buttons work, but they are showing strange behavior.
To play a video I have the following in the button:
<onclick>close</onclick>
<onclick>PlayMedia($INFO[ListItem.FileNameAndPath],noresume)</onclick>
I figured out quickly that the close in the first one was necessary or the dialog window stayed open when the video started playing. Using the above the video starts fine just as normal. The same goes if you click on the button to resume. Here is where it get's strange. After you are done watching the video, either if you watch it in it's entirety or stop it early. Then you go and click on that same video in the library again, nothing happens. If you click on it several times, you eventually get an error:
"One or more items failed to play. Check the log for more information about this message"
Or I just don't get anything. If I click on anything else it will play just fine, so it only does this with the very last video that I played. The only thing I can think of is perhaps my onclick code above is not correct.
Also here is my recent log that seems to show that Kodi is unable to get a filename from my selection. I am attempting to make the selection from the library page itself, it won't even load to the info screen if this has happened.
Here is a copy of my log:
https://paste.kodi.tv/zuqerimole.kodi
The idea is I am using conditional visibility to hide or show certain buttons. So in the end if it's a video that cannot be resumed, it will simply have a play button. If it can be resumed, you will see two buttons, one for start over and the other for resume.
As of right now these buttons work, but they are showing strange behavior.
To play a video I have the following in the button:
<onclick>close</onclick>
<onclick>PlayMedia($INFO[ListItem.FileNameAndPath],noresume)</onclick>
I figured out quickly that the close in the first one was necessary or the dialog window stayed open when the video started playing. Using the above the video starts fine just as normal. The same goes if you click on the button to resume. Here is where it get's strange. After you are done watching the video, either if you watch it in it's entirety or stop it early. Then you go and click on that same video in the library again, nothing happens. If you click on it several times, you eventually get an error:
"One or more items failed to play. Check the log for more information about this message"
Or I just don't get anything. If I click on anything else it will play just fine, so it only does this with the very last video that I played. The only thing I can think of is perhaps my onclick code above is not correct.
Also here is my recent log that seems to show that Kodi is unable to get a filename from my selection. I am attempting to make the selection from the library page itself, it won't even load to the info screen if this has happened.
Here is a copy of my log:
https://paste.kodi.tv/zuqerimole.kodi