v16 dynamic stack scheme url request
#1
Hi, all

I'm writing a player for a video site, and got a problem.

The video is seperated into many pieces, and I can combine them into a stack, play this video using stack:// scheme,

Everything is OK until I found the url has a expire time, when the player tried to play the next piece, the url is expired, and kodi exited.

Unfortunately I could not replace the url before player terminate the job.

Using playlist, and cache the remote file to locale directory solved the problem, but that not good enough.

I've read the source code of kodi, and found the player can just read a string returned by python function

what I want to do next is to write a native function for the player which can execute python lambda code like this

stackurl = []
for piece in pieces:
stackurl.append(lambda:getUrl(piece))
xmbc.Player().play(stackurl, listitem)

where pieces is a array containing basic arguments for calculate the final url

getUrl handles these arguments and return the finalUrl.

so that when player plays the next piece of video, it'll first execute the lambda, and get the latest url.

what's more when user try to seek to a location, the player can get the latest url from lambda

I'm wondering is there any better solution to get this job done,

and also I found some feature request like this, but not sure there's any plan to develop this feature

Cheers~
Reply

Logout Mark Read Team Forum Stats Members Help
dynamic stack scheme url request0