tccoin / Jellyfin-Potplayer

Play with Potplayer
106 stars 26 forks source link

ConnectionManager is undefined and ApiClient is undefined in userscript.js #3

Closed hestenet closed 3 years ago

hestenet commented 3 years ago

As requested - opening a new issue for this:

I am having a problem with ConnectionManager is undefined and ApiClient is undefined.

image

The regedit successful added the potplayer:// protocol handling, and if I directly enter an address like: potplayer://localhost:8096/Items/a0e731206375627cda2e34fad7589610/Download?api_key=d948b800b182411799c525225aa2bd18 into the browser, the powershell script successfully runs and the video content plays.

But if I simply click to play, nothing happens in the browser and in the browser console I see these errors: image

I cannot tell from the thread above how the undefined errors were solved. Thanks for any help.

Originally posted by @hestenet in https://github.com/tccoin/Jellyfin-Potplayer/issues/1#issuecomment-860143272

hestenet commented 3 years ago

Re: Jellyfin version - I was using: 10.7.5 - the latest windows stable.

ansonhorse commented 3 years ago

Re: Jellyfin version - I was using: 10.7.5 - the latest windows stable.

You may try this:

let openPotplayer = async (itemid) => {
    let userid = (await ApiClient.getCurrentUser()).Id;
....
tccoin commented 3 years ago

Re: Jellyfin version - I was using: 10.7.5 - the latest windows stable.

You may try this:

let openPotplayer = async (itemid) => {
    let userid = (await ApiClient.getCurrentUser()).Id;
....

I've tested your codes in both the old and new versions of Jellyfin and it works! Great Job! I've updated the script. @hestenet Please update the user script in userscript.js and it should work fine now.