Jump to content

How to use OpenToken to play Live TV?


VicMoore
 Share

Recommended Posts

I have learned how to play movies and tv shows from the EMBY library.  I am now trying to play live content.  To do so I have watched what the Web Client does. Before playing the movie It POSTS a request for PlayBackInfo to the server:

http://192.168.1.201:8096/emby/Items/2564423/PlaybackInfo?UserId=e62c08bb99774ba794d6bcec82f76237&StartTimeTicks=0&IsPlayback=true&AutoOpenLiveStream=true&MaxStreamingBitrate=140000000&X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id=20630783-23d6-40c3-9e69-414ea652ba5d&X-Emby-Client-Version=4.7.8.0&X-Emby-Token=1069c4b9b861424daf92bb47a7c0a050&reqformat=json

It receives back the LiveStreamId, which it uses later to play the IPTV stream

LiveStreamId: "06044cf0e6f93cdae5f285c9ecfaaeb4_01413a525b3a9622ce6fdf19f7dde354_45ff95b613fc94aee5320bdf127133dd"

When I issue the same request for PlayBackInfo i don't get the LiveStreamId.  Instead I get an  OpenToken.

OpenToken: "06044cf0e6f93cdae5f285c9ecfaaeb4_2564423_45ff95b613fc94aee5320bdf127133dd"

How do I use this OpenToken to get the LiveStreamId so I can play the stream with hls.js?

Vic

 

 

 

Link to comment
Share on other sites

HI, admittedly this whole sequence of communications is not well documented, so until I'm able to do that I would suggest mimicking the requests that the web app uses by monitoring them in the browser debugger.

Link to comment
Share on other sites

It used to be required with another request to open the live stream after /playbackinfo, but nowadays you can just add the param AutoOpenLiveStream=true to /playbackinfo and then I don't think you have to worry about it. You still have to close the live stream later though, but that gets handled for you when you report playback stopped.

Link to comment
Share on other sites

 

Thanks Luke, that worked, now I have the same "master.m3u8" url as the web app.  I give this url to hls.js program. But the live tv still does not play. I get an "error starting ffmpeg" error.

I have attached the server log below. 

Vic

embyserver (2).txt

Link to comment
Share on other sites

Luke, both logs are attached below.

The live channel, from which the logs below apply, did not play in my code or the Emby web app.  I tried to play other channels and they worked OK. 

Vic

embyserver (3).txt ffmpeg-transcode-38dee6ee-5931-4ad0-ad76-813fb397a9f5_1.txt

Edited by VicMoore
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...