Duration of Audiofile if opend from online source
I working in Python:

I have added some urls to a playlist and like to have the duration of the audiofiles from the urls be displayed while playing the url.

Since the duration is displayed by so much addons (mostly videoaddons) using online sources i think i miss just a small part.

Do this depend on the fileformat served by the url? If yes what formats could be used to have the duration displayed.
If the duration is available, then you can get it via infolabels. Total duration of playlist (if available).

duration = xbmc.getInfoLabel("Player.Duration")

Duration of current track.

current_duration = xbmc.getInfoLabel("MusicPlayer.Duration")

If it's a live stream then the duration will be zero.

See https://kodi.wiki/view/InfoLabels#Player_labels (wiki)
Learning Linux the hard way !!
Thanks but getting the Information is not the Problem. I link to set the duration information.

As example:

1) I start a youtube-video and there is a duration
2) I start a mp3 from "http://example.com/myaudio.mp3 and there is no duration in the kodiplayer.

How do i get the second to the first?
Usually, if you click on the page and bring up 'view page source', there's sometimes a <duration> etc. tag which has a string of numbers which I believe is the length in seconds the video or mp3 is. Search the HTML for the word duration or length and see what comes up
Thank you but i already know the duration. I have full control of the Servercode and the kodiaddon. I have the duration and have set them in the attached musicinfotag of the listitems, but the player isnt use the info if the path is an URL to a file in a Server.

I like to know where i need to set the duration inside my kodiaddon code to get the info displayed while playing the url
Thread Rating:
  • 0 Vote(s) - 0 Average

Logout Mark Read Team Forum Stats Members Help
Duration of Audiofile if opend from online source00