anarchintosh Wrote:I mean, the query string name must be defined somewhere? Or how would the web player know what it is? If it isn't defined in the actual .flv , then i guess it will be defined in the web player flash code
also, confusingly, megavideo doesn't even use query strings eg.
http://www.megavideo.com/?v=I1CZJKEG
it literally just appends a number onto the end of the url
basically, i still think it would be good to implement a proper python callback onSeek event
the flv metadata could be really useful, and give us some 'smart' functions, but as much as i would love it, i'm not sure the problem can be completely solved by some auto generated logic...
I agree, the seek keyword should be determined by the plugin developer and passed to the core player, as I am not sure you can find this info in the metadata and like you said it might be in the player code.
I am not sure about the seek callback event, is this an expensive operation? time-wise?
Is it easy to implement?
This is a dirty pseudo code of what I was thinking about.
In Python:
IF SeekPoints in Metada //Plugin developers need to verify this condition
--Find/Parse SeekKeyword //SeekKeyword is what gets appended to end of the url and before the seek value. It can be an empty string or any other keyword (start,ec_seek, etc..)
--CALL xbmc.player(URL, SeekKeyword)
In Core Player:
//Method to parse metada from stream. This is very easy to implement, I already have it implemented in java.
ParseMetadata (FLV)
--return filepositions[], time[]
//Find the index of the closest valid queued time from metadata (this is for forward, it can be changed for rewind/backward)
IndexClosestTime (seconds, time[])
--while (time[i] < length.time )
----If seconds <= time[i]
------Exit Loop
----Else i++
--//you can add more logic to get a closest value between second and time +or- 1
--return i
XBMC Core Player (URL, SeekKeyword)
--URL //The FLV URL you pass to xbmc player
--SeekKeyword //Keyword that gets appended to the URL, it can be an empty string
--FilePositions //Array of the queued bytes parsed from the metatadata
--time //Array of the actual time in seconds parsed from the metadata and mapped to the filepositions array
----Play (URL)
------filepositions, time = ParseMetadata (URL)
------play //start the movie as normal
----Seek (seonds)
------If buffered //check the normal cache to see if the seek request is in the current buffer. The current code already does that
--------seek //seek as normal
------ElseIf SeekKeywords Not Null
--------index IndexClosestTime (seconds, time[])
--------NewURL = URL + SeekKeyword + FilePositions[i]
--------Play(NewURL)
------Else
--------Wait for it to buffer //current behavior