2015-08-20, 16:58
Hello,
I apologize if similar question was asked before. Anyway, I am trying to write a simple video addon.
I found CCTV5 replay can be viewed with this kind of URL:
http://8.37.234.13/v.cctv.com/live_back/...host=local
the stream is five minutes long. It will be continued by
http://8.37.234.13/v.cctv.com/live_back/...host=local.
I figured out how to calculate the next url in general, (after the 19-23-012, the next one would be 20-00-001, etc),
So I simply create a dead loop to have the video keep going with something like "while TRUE: play url; time.sleep(300); generate the next url ...
However, from Kodi even if I quit this addon by press "menu" buttom on aTV's remote control, it seems the dead loop is still running because after within 5 minutes, a video come up playing again, and again, forever ...
Any way I can catch the event that user is leaving this addon so I can end the dead loop?
Instead of a dead loop, any better way to playing next segment until you click away this addon?
Sample codes will be greatly appreciated, or if someone could write an addon.
Thanks!
-Kang
I apologize if similar question was asked before. Anyway, I am trying to write a simple video addon.
I found CCTV5 replay can be viewed with this kind of URL:
http://8.37.234.13/v.cctv.com/live_back/...host=local
the stream is five minutes long. It will be continued by
http://8.37.234.13/v.cctv.com/live_back/...host=local.
I figured out how to calculate the next url in general, (after the 19-23-012, the next one would be 20-00-001, etc),
So I simply create a dead loop to have the video keep going with something like "while TRUE: play url; time.sleep(300); generate the next url ...
However, from Kodi even if I quit this addon by press "menu" buttom on aTV's remote control, it seems the dead loop is still running because after within 5 minutes, a video come up playing again, and again, forever ...
Any way I can catch the event that user is leaving this addon so I can end the dead loop?
Instead of a dead loop, any better way to playing next segment until you click away this addon?
Sample codes will be greatly appreciated, or if someone could write an addon.
Thanks!
-Kang