Multithread HTTP streaming, seekTime
#1
Hi, i'm trying to make multithread streaming by HTTP.
To do this, I download the file with mutiple http connections, and as soon as I have enough bytes to start streaming I call myplayer.play(filepath, listitem).

myplayer is a class that inherit from xbmc.Player and override play() and implements onPlayBackStopped, onPlayBackEnded and onPlayBackSeek.

This works well and is very fast, now the problem is when i try to seek at certain position.
When i seek, "onPlayBackSeek" was called, but player stops becouse EOF (End Of File).

So I tried this:
Code:
def onPlayBackSeek(self, time, seekOffset):
        self.pause()
        # code to download file starting at seek offset and wait for first bytes
        # self.play()
        util.notify("SEEK %d %d" % (time, seekOffset))

but player doesn't pause, it say always EOF and close itself.

I think that when I seek was called the player method "def seekTime(self, pTime)" and is this method that manage EOF and close player.
There is a way to override this one?
I'm tryed this:
Code:
def seekTime(self, pTime):
        print "HERE!"

but "HERE!" is never printed (i mean in xbmc.log) so my "seekTime" method is never called.

Thanks[/code]
Reply
#2
Have you tried to introduce a while loop after calling the play function?

PHP Code:
play(...)
while 
player.playing:
    
xbmc.sleep(1000

This happened me loads of times, the only way I managed to solve it was to add that loop.
Note I might be saying rubish Wink
Reply
#3
Yes, this is only way to catch onPlayBack* methods.

But "seekTime(self, pTime)" is never called Sad
Reply
#4
You're probably doing something wrong then...without the full code or a bit more of details I doubt anyone will be able to help you out.
I don't understand if you're trying to seek time on the player or to catch the onplaybackseek event. If that's the case, from the python docs:

Quote:onPlayBackSeek(...)
onPlayBackSeek(time, seekOffset)--onPlayBackSeek method.

time : integer - time to seek to.
seekOffset : integer - ?.

Will be called when user seeks to a time
Reply
#5
I'm trying to override seekTime methods.

onPlayBackSeek works but is useless.
Reply
#6
You may want to check out a project a couple of us have been working on which we called Axel Downloader

https://github.com/Eldorados/script.modu...downloader

Does basically the same thing, but instead is a separate module that creates a proxy which you point your player to, this allows seeking to work easily
Reply
#7
My experience on growing files is you can't seek past what the demux thinks is EOF and it is not dynamic, You might be able to FF and it will play. If it is a stream it just dies at the original eof.

Martin
Reply

Logout Mark Read Team Forum Stats Members Help
Multithread HTTP streaming, seekTime0