Hi,
I am working on an addon to change my lighting when starting/pausing/stopping a movie. That all works fine, but I only want to change the lighting when playing "real" movie not when for example playing music videos or watching youtube.
For this I want to check if the duration is > 60 minutes. If so then I assume it is a movie. The movietimes show correctly in the library.
I tried using xbmc.Player().getTotalTime() and xbmc.getInfoLabel('VideoPlayer.Duration'), but these don't always give the correct duration.
The wrong durations seems to happen with movies that have a menu or movies that have an intro (e.g. the pixar lamp). There I get the duration that is a lot shorter than the movie.
BTW I am checking for the duration in the onPlaybackStarted callback/event function.
Is there a way to get the duration as is displayed in the library?
I am working on an addon to change my lighting when starting/pausing/stopping a movie. That all works fine, but I only want to change the lighting when playing "real" movie not when for example playing music videos or watching youtube.
For this I want to check if the duration is > 60 minutes. If so then I assume it is a movie. The movietimes show correctly in the library.
I tried using xbmc.Player().getTotalTime() and xbmc.getInfoLabel('VideoPlayer.Duration'), but these don't always give the correct duration.
The wrong durations seems to happen with movies that have a menu or movies that have an intro (e.g. the pixar lamp). There I get the duration that is a lot shorter than the movie.
BTW I am checking for the duration in the onPlaybackStarted callback/event function.
Is there a way to get the duration as is displayed in the library?