Jump to content

How to stop a HTTP Live Streaming movie


VicMoore

Recommended Posts

VicMoore

I have an app that plays emby movies via HLS and an HTML5 video tag. The emby documentation says that "After playback is complete, it is necessary to inform the server to stop any related HLS transcoding. This is accomplished via an HTTP DELETE to:  /Videos/ActiveEncodings?DeviceId=xxx"

This doesn't stop the stream itself. I stop playing the movie by removing the HTML5 video tag from the DOM and then I send the DELETE above. Is this a correct way to stop an HLS stream? Is there a better way?

Vic

Link to comment
Share on other sites

Hi, what do you mean by doesn't stop the stream itself? Are you saying you want to stop during playback?

Link to comment
Share on other sites

VicMoore

Yes, I want to stop one stream during playback and start another. Currently I just remove the HLS player and video tag for the playing stream from the DOM. Next I add back a new video tag and HLS player. I then attach the new source url to the new video tag and start it playing. I was wondering how Emby would know that I no longer needed the m3u8 segment files for the first stream. Does it garbage collect them if they are not requested? I was just curious.

Vic

Link to comment
Share on other sites

VicMoore

OK, I added Playback checkin. Where do I get the "PlaybackStartInfo" for the POST body? 

Vic

Link to comment
Share on other sites

The values you need to send are all in the wiki. I would go over and also compare to what the web app sends. Let us know if you have questions after that. Thanks.

Link to comment
Share on other sites

VicMoore

Good morning Luke...

What is the simplest  POST payload that can register and update video playbacks? I have tried to build my own with very little success. So many of the parameters given in the WIKI are foreign to me. I finally have the HTML5 HLS working and would like to see the status of playing videos on the Emby dashboard. 

Below I have attached the application that I have built. Through it I have learned some of the Emby API. I use it to build channels for the Virtual TV plugin.  It's simple code and others might be able to learn from it. Give it a try. It's just one  HTML file with javascript and JQuery.  Fill in your server URL and API key. Also make sure that JS, jQuery, and HLS are being fetched properly from the CDN.

Thank you for all of the help you have given me.

Vic

emby2.html

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
×
×
  • Create New...