Player.seekTime directly after Player.play
#1
Hey folks,

I am trying to start an audio file directly at a specific timestamp. I am doing it like this in two steps:

Code:
xbmc.Player().play('d:\\test.mp3')
xbmc.Player().seekTime(20)

But the call to seekTime is ignored.

It works when I add a small pause before calling seekTime:
Code:
xbmc.Player().play('d:\\test.mp3')
time.sleep(1)
xbmc.Player().seekTime(20)

But we all know this is ugly. Any idea how to start playing at a timestamp without such a hack?
Thanks in advance!
Reply
#2
You'll probably have to listen for the onPlayBackStarted() event
Reply
#3
If you set the item as a listitem, then you can use the resume properties

Code:
playurl="C:\some\file.mp3"
        item = xbmcgui.ListItem(path=playurl)
        item.setProperty('ResumeTime', '30' )
        item.setProperty('TotalTime', '20000' )
        return xbmcplugin.setResolvedUrl(pluginhandle, True, item)
Add-on:PleXBMC (wiki) - Play Plex media through XBMC
PleXBMC Helper - Integrate Official/Unoffical Plex remote control apps into PleXBMC
PleXBMC Repository - install and manage all PleXBMC addons
Quartz3 PleXBMC - Integrate PleXBMC into home menus
Reply

Logout Mark Read Team Forum Stats Members Help
Player.seekTime directly after Player.play0