Jump to content


Photo

Emby External Player Launcher

Emby External Player Launcher EmbyExternalPlayerLauncher E2PL MPC-HC external external player

  • Please log in to reply
75 replies to this topic

#41 Bloodred OFFLINE  

Bloodred

    Advanced Member

  • Members
  • 52 posts
  • Local time: 04:12 AM

Posted 22 September 2017 - 06:11 PM

Auto-reconnect is now back, in v1.1.0.0. Don't worry too much if you see JSON-related exceptions in the log coming from the ApiClient, as they do not affect functionality as far as I can tell.

 

-----

 

Hey @Luke, I've noticed that the new ApiClient versions log a lot of JsonReaderExceptions, though this does not seem to affect the functionality of the methods and events I use for E2PL. I don't think I'm misusing anything, as the exceptions appear to be coming from internal deserialization of WebSocket messages, due to incorrect JSON. Any idea why? They look like this:

Spoiler


#42 HaraldBluetooth OFFLINE  

HaraldBluetooth

    Advanced Member

  • Members
  • 85 posts
  • Local time: 03:12 AM

Posted 27 September 2018 - 06:19 AM

Hi, thanks for this nice app, just what I need :)

I have installed your program on my local PC (Windows 10 Pro fully updated), where EMBY server is running, with a working movie library from several external disks connected via USB3.

 

When I choose your launcher in the webbrowser (Both EDGE and Chrome) and try to play, nothing happens. I've already had the 64 bit version of MPC-HC installed before I installed the 32 bit version too.

 

I get this in the log file:

2018-09-27 12:08:23,023 [53 ] ERROR EmbyExternalPlayerLauncher.ServerConnect.EmbyPlayerConnector - Play command failed.
MediaBrowser.Model.Net.HttpException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Emby.ApiClient.Net.HttpWebRequestClient.<GetResponse>d__10.MoveNext()
   --- End of inner exception stack trace ---
   at Emby.ApiClient.Net.HttpWebRequestClient.<GetResponse>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Emby.ApiClient.Net.HttpWebRequestClient.<SendAsync>d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Emby.ApiClient.ApiClient.<SendAsync>d__30.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Emby.ApiClient.ApiClient.<GetItemAsync>d__40.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at EmbyExternalPlayerLauncher.ServerConnect.EmbyPlayerConnector.<Client_PlayCommand>d__26.MoveNext()

 

Can you please help me?
 


Edited by HaraldBluetooth, 27 September 2018 - 06:39 AM.


#43 Bloodred OFFLINE  

Bloodred

    Advanced Member

  • Members
  • 52 posts
  • Local time: 04:12 AM

Posted 27 September 2018 - 01:23 PM

Hi!

 

That looks like the server is returning a HTTP 500 error. Generally speaking that error code means the server encountered some sort of unexpected error, so it could be helpful for you to check the server log to see if there is any information there about what the server failed to do exactly. Since this is happening when E2PL is trying to process a Play command and you're not seeing a player start, it probably means E2PL tries to retrieve information about the file you want to play but the request to the server fails.

 

It could be that there's something wrong with your Emby server (not sure what) but it could also happen if the Emby client E2PL uses is no longer compatible with the server version you have. What server version are you running? It's pretty bad news if it turns out the Emby client is incompatible since an update version does not seem to be available.

 

Everything is working for me but my server is older. I'll investigate when I have some time, maybe over the weekend.



#44 HaraldBluetooth OFFLINE  

HaraldBluetooth

    Advanced Member

  • Members
  • 85 posts
  • Local time: 03:12 AM

Posted 29 September 2018 - 03:29 PM

Thanks for your answer Bloodred. My server version is latest beta 3.6.0.49. I have the same problem with the app MPCRemote, that worked for me until server version 3.6.0.30. I don't know if this is related or something else is wrong.

 

I have tried with many different movies, that all play fine directly in the web-browser, or if I play them in MPC-HC from file explorer. Emby Theater also play these files fine both directly and with MPC-HC as external player. The movies are almost all 720p or 1080p x264 mkv's.


Edited by HaraldBluetooth, 29 September 2018 - 03:51 PM.


#45 Bloodred OFFLINE  

Bloodred

    Advanced Member

  • Members
  • 52 posts
  • Local time: 04:12 AM

Posted 29 September 2018 - 10:31 PM

I've installed the latest beta myself and sadly it does seem to be a mismatch between the newest available Emby API client and the beta, as in the server complains about the input not being in the correct format which I assume happens due to the expected format changing in the new server. I can't find an updated version of the Emby API client package yet, maybe it hasn't been released since the server itself is still in beta.

 

Anyway, this means there's nothing wrong with your setup in particular, but that E2PL is currently incompatible with this version of the server. I'll investigate more to see if I can get it fixed without a new Emby client package, but in the meantime the obvious workaround would be to use an older version of the Emby server if you need to get this working.



#46 HaraldBluetooth OFFLINE  

HaraldBluetooth

    Advanced Member

  • Members
  • 85 posts
  • Local time: 03:12 AM

Posted 30 September 2018 - 03:51 AM

Thanks Bloodred, I will wait for your update.

 

Unfortunately I can't downgrade to an old server version, because there was some database changes i version 3.6.0.31, so my workaround is to start the movie from file explorer or use Emby Theater.



#47 Bloodred OFFLINE  

Bloodred

    Advanced Member

  • Members
  • 52 posts
  • Local time: 04:12 AM

Posted 30 September 2018 - 10:03 AM

I've tried to build the latest version of the API client I could find from source (last change 5 months ago) but this doesn't seem to address the compatibility issue with the beta server. I think we'll have to wait for an official update to be released, at which point I hope to be able to easily integrate the new version into E2PL.



#48 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 138046 posts
  • Local time: 09:12 PM

Posted 30 September 2018 - 11:10 AM

what exactly is the problem?



#49 Bloodred OFFLINE  

Bloodred

    Advanced Member

  • Members
  • 52 posts
  • Local time: 04:12 AM

Posted 30 September 2018 - 01:29 PM

In short: trying to call the GetItemAsync method on the ApiClient (v3.1.0 nuget package) when the Emby server is the latest 3.6.0.50 beta fails with a HTTP 500 error.

 

Checking the server's log reveals an exception about input being in an invalid format, which I assumed was due to changes in the server's API which have not trickled down into the ApiClient package yet. This is the point where playback through E2PL fails, I'm not sure if other methods are affected as well or not.

 

Client-side exception:

2018-09-30 20:25:22,037 [148] ERROR EmbyExternalPlayerLauncher.ServerConnect.Logging.EmbyLogger - Error getting response from http://localhost:8096/emby/Users/1/Items/313?format=json
System.AggregateException: One or more errors occurred. ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Emby.ApiClient.Net.HttpWebRequestClient.<GetResponse>d__10.MoveNext()
---> (Inner Exception #0) System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)<---

2018-09-30 20:25:22,038 [148] ERROR EmbyExternalPlayerLauncher.ServerConnect.EmbyPlayerConnector - Play command failed.
MediaBrowser.Model.Net.HttpException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Emby.ApiClient.Net.HttpWebRequestClient.<GetResponse>d__10.MoveNext()
   --- End of inner exception stack trace ---
   at Emby.ApiClient.Net.HttpWebRequestClient.<GetResponse>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Emby.ApiClient.Net.HttpWebRequestClient.<SendAsync>d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Emby.ApiClient.ApiClient.<SendAsync>d__30.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Emby.ApiClient.ApiClient.<GetItemAsync>d__40.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at EmbyExternalPlayerLauncher.ServerConnect.EmbyPlayerConnector.<Client_PlayCommand>d__26.MoveNext()

And the corresponding exception in the server's log:

2018-09-30 20:25:20.693 Info HttpServer: HTTP GET http://localhost:8096/emby/Users/1/Items/313?format=json. UserAgent: 
2018-09-30 20:25:20.698 Error HttpServer: Error processing request
	*** Error Report ***
	Version: 3.6.0.50
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Unix 4.15.0.34
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: True
	Processor count: 2
	Program data path: /var/lib/emby
	Application directory: /opt/emby-server/system
	System.FormatException: Input string was not in a correct format.
	Source: ServiceStack.Text
	TargetSite: System.Guid ParseGeneralStyleGuid(System.ReadOnlySpan`1[System.Char], Int32 ByRef)
	   at ServiceStack.Text.DefaultMemory.ParseGeneralStyleGuid(ReadOnlySpan`1 value, Int32& len)
	   at ServiceStack.Text.DefaultMemory.ParseGuid(ReadOnlySpan`1 value)
	   at ServiceStack.Text.Common.DeserializeBuiltin`1.<>c.<GetParseStringSpanFn>b__7_6(ReadOnlySpan`1 value)
	   at ServiceStack.Text.Jsv.JsvReader.<>c__DisplayClass2_0.<GetParseFn>b__0(String v)
	   at Emby.Server.Implementations.ApplicationHost.<>c__DisplayClass300_0.<GetParseFn>b__0(String s)
	   at Emby.Server.Implementations.Services.StringMapTypeDeserializer.PopulateFromMap(Object instance, IDictionary`2 keyValuePairs)
	   at Emby.Server.Implementations.Services.RestPath.CreateRequest(String pathInfo, Dictionary`2 queryStringAndFormData, Object fromInstance)
	   at Emby.Server.Implementations.Services.ServiceHandler.CreateRequest(IRequest httpReq, RestPath restPath, Dictionary`2 requestParams, Object requestDto)
	   at Emby.Server.Implementations.Services.ServiceHandler.CreateRequest(HttpListenerHost host, IRequest httpReq, RestPath restPath, ILogger logger)
	   at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, ILogger logger, String operationName, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, String urlString, String host, String localPath, CancellationToken cancellationToken)
	
2018-09-30 20:25:20.698 Info HttpServer: HTTP Response 500 to 10.0.2.2. Time: 5ms. http://localhost:8096/emby/Users/1/Items/313?format=json

I'm assuming that FormatException on the server is due to something having changed in the API, it looks like it's expecting a GUID but the ApiClient method takes regular strings and I don't believe they follow a GUID format, for instance while debugging I saw that item IDs returned in a PlayRequest just contain numbers (in this case "313").


Edited by Bloodred, 30 September 2018 - 01:36 PM.


#50 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 138046 posts
  • Local time: 09:12 PM

Posted 30 September 2018 - 01:41 PM

where did you get the user id from?



#51 Bloodred OFFLINE  

Bloodred

    Advanced Member

  • Members
  • 52 posts
  • Local time: 04:12 AM

Posted 30 September 2018 - 01:51 PM

From the PlayRequest, as in playReq.ControllingUserId (in this case it's "1").



#52 Elegant OFFLINE  

Elegant

    Advanced Member

  • Members
  • 32 posts
  • Local time: 08:12 PM

Posted 15 December 2018 - 04:44 AM

Any chance for the launcher to support the https port? It doesn't seem to like the certificate used by my proxy. Thanks!



#53 Bloodred OFFLINE  

Bloodred

    Advanced Member

  • Members
  • 52 posts
  • Local time: 04:12 AM

Posted 15 December 2018 - 12:31 PM

Hi, I'm afraid I don't know much about how HTTPS support works with Emby and I don't have it set up myself. The connection to the server is established in the Emby API client library, so the E2PL doesn't touch that directly at all, though I don't know at this point if there's any special setup/configuration required in order for it to support HTTPS.

 

More of a guess than anything else, but are you using a self-signed certificate or one signed by a CA which isn't trusted by default on your proxy? That might cause the connection to fail I assume, so if this is the case it might help to try to get your hands on a different certificate or to configure your CA as trusted in Windows (I don't remember exactly what the process for this was) with the hope that the Emby client will know to pick up on that. Sorry I can't be of more help, but when I get some time I'll have a quick look to see if there's anything I could do from the E2PL side.



#54 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 138046 posts
  • Local time: 09:12 PM

Posted 15 December 2018 - 01:08 PM

For HTTPS you will need to supply a certificate under Advanced settings.



#55 Elegant OFFLINE  

Elegant

    Advanced Member

  • Members
  • 32 posts
  • Local time: 08:12 PM

Posted 15 December 2018 - 03:12 PM

@Bloodred The reverse proxy is providing the CA signed certificate and Windows does trust it per the attached.

 

@Luke In this case, wouldn't Emby require the CA instead of the certificate since it's handled by the reverse proxy? I wasn't able to spot an option to supply the CA.

 

 

Attached Files



#56 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 138046 posts
  • Local time: 09:12 PM

Posted 15 December 2018 - 03:25 PM

There is a setting in the advanced section of the server dashboard to allow you to indicate that https is being handled by your reverse proxy.



#57 Elegant OFFLINE  

Elegant

    Advanced Member

  • Members
  • 32 posts
  • Local time: 08:12 PM

Posted 15 December 2018 - 04:01 PM

"Secure Connection Mode" is already set to "Handled by reverse proxy" though, is there something else required? Thanks!



#58 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 138046 posts
  • Local time: 09:12 PM

Posted 15 December 2018 - 05:26 PM

That's all you need to do.



#59 Elegant OFFLINE  

Elegant

    Advanced Member

  • Members
  • 32 posts
  • Local time: 08:12 PM

Posted 15 December 2018 - 10:44 PM

Unfortunately, it's not working. Whenever I connect using emby.svc.example.com:443 I am met with "Could not connect to Emby. Please check your settings." If I revert to using emby.svc.example.com:80, I have no issues. 80 and 443 (SSL) are the ports used for the reverse proxy, Emby is still using 8096 internally. Something must be missing...


Edited by Elegant, 15 December 2018 - 10:48 PM.


#60 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 138046 posts
  • Local time: 09:12 PM

Posted 16 December 2018 - 12:14 AM

Not working from where?







Also tagged with one or more of these keywords: Emby External Player Launcher, EmbyExternalPlayerLauncher, E2PL, MPC-HC, external, external player

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users