lampa-source
lampa-source copied to clipboard
Understanding LG TV Subscribe Method
Hi @yumata , I hope you're doing well, I'm the dev lead at Stremio, we talked some years ago on telegram (not sure if you remember)
I was hoping we could get your input on an issue we have in Stremio, the WebOS video player (available at: https://github.com/Stremio/stremio-video/blob/master/src/WebOsVideo/WebOsVideo.js ) uses very similar logic to the Lampa video player.
What we do is:
- we set
video.src
to the streaming URL (wherevideo
is the HTML5 video element) - we try to subscribe to video events with Luna, see: https://github.com/Stremio/stremio-video/blob/master/src/WebOsVideo/WebOsVideo.js#L237
- we wait for
result.sourceInfo
(this is where the issue is, sometimes the sourceInfo object is never retrieved, and this happens frequently for us..) - we unsubscribe
- we do
video.load()
- we do
video.play()
I've been trying to figure out what the issue is with our implementation for weeks but had no success, so I'm writing you in hopes that you could help us figure it out.
Sometimes the subscribe method fails with {"errorCode":0,"returnValue":false,"errorText":"No Error","mediaId":"<invalid mediaId>"}
(retrying seems to fix this though..) other times it fails with {"serviceName":"com.webos.pipeline._2aviVu524UNA9e","returnValue":false,"errorCode":-1,"errorText":"com.webos.pipeline._2aviVu524UNA9e is not running."}
(this one sometimes retrieves sourceInfo, but not always) and there are even times where there is no error at all, yet it still does not get sourceInfo
Users say that if they close the stream and start it again a few times, the sourceInfo is retrieved correctly at some point.
What we noticed is that when it does not work at all, the result.bufferRange
always shows 0
for details. (it is like it doesn't try to load the video at all)
Here is an example of logs when it does not work: (and had no error)
And here is an example of logs when it does work:
We're really hoping that you could offer some clues on getting this working properly, thanks in advance!