Duration of Audiofile if opend from online source
#1
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.
Reply
#2
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 !!
Reply
#3
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?
Reply
#4
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
Reply
#5
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
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



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