Jump to content

Emby Server api


Recommended Posts

Posted

Haven't had a chance to look at this yet but please be aware this would only be a convience method. Everything is already there in the api for you to resume video.

Posted

To resume media, you have to look at the items resume state, which is a boolean value if it is resumable, from a bookmarked location.

 

Then there is a value available when requesting specific item info with a resume point.

 

I have my Alexa skill tell me if a movie is book marked and asks if I want it to resume.

 

I can post code here with more specific routines if that helps anyone.

 

I have it working perfectly though.

PrincessClevage
Posted (edited)

To resume media, you have to look at the items resume state, which is a boolean value if it is resumable, from a bookmarked location.

 

Then there is a value available when requesting specific item info with a resume point.

 

I have my Alexa skill tell me if a movie is book marked and asks if I want it to resume.

 

I can post code here with more specific routines if that helps anyone.

 

I have it working perfectly though.

Hi Chef,

Currently I can not get the resume last playing movie to work from Rigpapa’s Vera > Emby app. The use and flow is as follows:

Motion sensor is triggered during armed window and main emby client or Xbox client are active and house is home or night mode then play relevant camera feed from your Surveillance plugin for emby to active client. After Surveillance camera is stopped the resume previously playing media (usually movie for me but Rigpapa has stated that playlist etc can not be resumed, see his previous post in this thread). I have everything working except for the last resume part, might this be something you can simulate with your setup?

Edited by PrincessClevage
BillOatman
Posted

To resume media, you have to look at the items resume state, which is a boolean value if it is resumable, from a bookmarked location.

 

Then there is a value available when requesting specific item info with a resume point.

 

I have my Alexa skill tell me if a movie is book marked and asks if I want it to resume.

 

I can post code here with more specific routines if that helps anyone.

 

I have it working perfectly though.

 

Is your Alexa skill the Emby Alexa skill?  

 

The link in your footer gives a 404 error :)

hooray4me
Posted

How do I determine the StartPositionTicks value? 

Posted

The user's last position will be in the item.UserData object.

hooray4me
Posted

oh. Is there a way to select playback position or chapter scene selection from the api?

BillOatman
Posted

I was thinking of starting another thread, but this question fits here :)

Your remote control link shows to play media, /Sessions/{Id}/Playing

 

The ,NET api equivalent seems to be SendPlayCommandAsync()

 

Part of what you pass in is

public string[] ItemIds

Is the purpose of an array of item IDs to play media sequentially, like a pre-roll followed by a movie for example?

hooray4me
Posted

@@Luke I'm having an issue with launching a show from the api for a FireTV stick. The show will launch/play but the menu options and loading circle stay on the screen and then the app crashes after about 30 seconds. 

 

5c8db6550cec7_20190316_214209.jpg

 

I launch the show with this command (variable values excluded):

curl -X POST "http://tv.xxxxx.xxx:8096/emby/Sessions/$Session/Playing?ItemIds=$Show&PlayCommand=PlayNow&api_key=$Token" -H "accept: */*" \
  -H "Content-Type: application/json" -d "{\"ControllingUserId\":\"$UserId\",\"SubtitleStreamIndex\":0,\"AudioStreamIndex\":0,\"StartIndex\":0}"

logs attached... thoughts?

 

server.log

hooray4me
Posted

@@ebr thoughts?

 

@@Luke I'm having an issue with launching a show from the api for a FireTV stick. The show will launch/play but the menu options and loading circle stay on the screen and then the app crashes after about 30 seconds. 

 

5c8db6550cec7_20190316_214209.jpg

 

I launch the show with this command (variable values excluded):

curl -X POST "http://tv.xxxxx.xxx:8096/emby/Sessions/$Session/Playing?ItemIds=$Show&PlayCommand=PlayNow&api_key=$Token" -H "accept: */*" \
  -H "Content-Type: application/json" -d "{\"ControllingUserId\":\"$UserId\",\"SubtitleStreamIndex\":0,\"AudioStreamIndex\":0,\"StartIndex\":0}"

logs attached... thoughts?

Posted

If he doesn't see this then I would open a topic in the Android TV section. Thanks.

hooray4me
Posted (edited)

oh. Is there a way to select playback position or chapter scene selection from the api?

 

 

Yes, our remote control API supports sending any start position you want:

https://github.com/MediaBrowser/Emby/wiki/Remote-control

 

Can you provide an example of playing item 11111 at like the 5 minute mark? The wiki is pretty vague on that.

http://tv.xxxxx.xxx:8096/emby/Sessions/someusersession/Playing?ItemIds=111111&PlayCommand=PlayNow&api_key=xxxxxxxxxxx &somecommand=300seconds ?
Edited by robrhedrick
hooray4me
Posted

I think it might be a problem with older fire sticks. I do my dev stuff on an older gen 1 or gen 2 device. I tried this on a newer one and it worked perfectly.

 

@@Luke I'm having an issue with launching a show from the api for a FireTV stick. The show will launch/play but the menu options and loading circle stay on the screen and then the app crashes after about 30 seconds. 

 

5c8db6550cec7_20190316_214209.jpg

 

I launch the show with this command (variable values excluded):

curl -X POST "http://tv.xxxxx.xxx:8096/emby/Sessions/$Session/Playing?ItemIds=$Show&PlayCommand=PlayNow&api_key=$Token" -H "accept: */*" \
  -H "Content-Type: application/json" -d "{\"ControllingUserId\":\"$UserId\",\"SubtitleStreamIndex\":0,\"AudioStreamIndex\":0,\"StartIndex\":0}"

logs attached... thoughts?

Posted

Using the chrome debugger is a great way to see examples, this will show you how the web app is doing it:

http://localhost:8096/emby/Sessions/9f0b9e07a63e6773fb13b1f1d6220f74/Playing?ItemIds=22651&PlayCommand=PlayNow&MediaSourceId=8d54f6e8461cacbbfcdb9040cdeb2267&AudioStreamIndex=1&SubtitleStreamIndex=4
  • Like 1
  • 4 weeks later...
PrincessClevage
Posted

Haven't had a chance to look at this yet but please be aware this would only be a convience method. Everything is already there in the api for you to resume video.

Hi Luke,

I now have the resume functionality working after armed security camera is triggered it plays automatically on either of my two main emby clients if they are active and streaming video (usually a movie) but when I stop the security camera footage and go back to previously playing media it auto starts the security camera footage again. I assume it is doing this because the security camera footage was the last recorded playing media, is it possible to auto resume previously playing footage (prior to the auto stream of the security camera footage e.g resume previously playing movie)?

Posted

Are these video files?

PrincessClevage
Posted

Are these video files?

My current testing has been video files yes but future state could be music also.
Posted

Ok, we'd have to look at an example in detail. And if this involves some code written by you or someone else, then that also means making sure the api is being used correctly. Thanks.

  • 3 weeks later...
hooray4me
Posted

I finally got all of this working inside Home Assistant. I have an automation that will launch emby on a certain firestick, play a movie and turn on the tv at a set time. Message me if you'd like the details.

 

5ccb40b9e1953_20190502_141008.png

  • Like 1
Posted

Very cool, thanks !

Senna
Posted

@@Luke
What has changed in Emby API access, because just installed 4.2.0.4 and it broke MrMC's Emby Client service access.

Did a quick test reverting back to 4.2.0.1 and MrMC API access works in there.

Posted

@@Luke

What has changed in Emby API access, because just installed 4.2.0.4 and it broke MrMC's Emby Client service access.

Did a quick test reverting back to 4.2.0.1 and MrMC API access works in there.

 

Nothing that I can think of. Remember you said the same thing during 4.1 development.

Senna
Posted

Nothing that I can think of. Remember you said the same thing during 4.1 development.

No, that was in 4.0.0.x branch, which they resolved around end of January 2019 and the problem then, was only for Emby users which had remote access disabled, which broke manual sign-in from MrMC's Emby Client service due to MrMC also expecting wan address from Emby server when connecting to it.

 

So in complete 4.1.x branch and 4.2.x  branch, MrMC's Emby access was working normally with every beta server version, but not with the latest 4.2.0.4 (on my system with local and remote Emby access with domain).

Will check with MrMC devs, to let them install latest Emby beta and so they can check their problem now, with MrMC's API access to Emby server.

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...