jellyfin / jellyfin-tizen

Jellyfin Samsung TV Client
https://jellyfin.org
928 stars 72 forks source link

Support for Tizen 2.4 #19

Open samuel9554 opened 4 years ago

samuel9554 commented 4 years ago

I don't know if that have been asked before. I've tried to build for my Samsung Tv running Tizen 2.4. Everything work fine but when I start the apps on the TV I just got a black screen. Probably the Chrome version is too old on it. Do we have a solution for older Tizen device?

dmitrylyzo commented 3 years ago

@jllodra In theory, this issue is due to a violation of the processing order of polyfilled CustomElements. But I don't know why it works on webOS 1.x I don't know how to make a second run (w/o reinstall) of app from Tizen Studio, but maybe this will be helpful.

HimbeersaftLP commented 3 years ago

grafik @dmitrylyzo Does this help? (Running v10.7.5 release, both web and server)

HimbeersaftLP commented 3 years ago

And here is the result of a location.reload(): grafik

dmitrylyzo commented 3 years ago

@HimbeersaftLP Thank you. They are both bad (asking you about exit), right?

The next is weird. It found the server (response status: 200) but was unable to connect. You should be redirected to the server selection page. But it decided that it should exit: https://github.com/jellyfin/jellyfin-web/blob/e27131edf0462c557d1c53ea4ee65fa6f4ac5b5c/src/components/appRouter.js#L529-L530

const isCurrentRouteStartup = this.currentRouteInfo ? this.currentRouteInfo.route.startup : true; const shouldExitApp = ctx.isBack && route.isDefaultRoute && isCurrentRouteStartup;

and exits (asking about exit): https://github.com/jellyfin/jellyfin-web/blob/e27131edf0462c557d1c53ea4ee65fa6f4ac5b5c/src/components/appRouter.js#L538-L544

route.isDefaultRoute and isCurrentRouteStartup is true because we are on the start page. ctx.isBack shouldn't be true, but it looks like it is :confused: It is set after popstate: https://github.com/jellyfin/jellyfin-web/blob/e27131edf0462c557d1c53ea4ee65fa6f4ac5b5c/src/components/appRouter.js#L33-L35 https://github.com/jellyfin/jellyfin-web/blob/e27131edf0462c557d1c53ea4ee65fa6f4ac5b5c/src/components/appRouter.js#L616-L622

Could you build jellyfin-web using yarn build:development (for 10.7) and put a breakpoint on the line const shouldExitApp = in file www/main.[hash].bundle.js after the first load? If ctx.isBack is true, then we are "going back" for some reason.

For master command would be npm run build:development.

HimbeersaftLP commented 3 years ago

They are both bad (asking you about exit), right?

Yeah

Could you build jellyfin-web using yarn build:development (for 10.7) and put a breakpoint on the line const shouldExitApp = in file www/main.[hash].bundle.js after the first load? If ctx.isBack is true, then we are "going back" for some reason.

I put a breakpoint on the line var shouldExitApp = ctx.isBack && route.isDefaultRoute && isCurrentRouteStartup;, then executed location.refresh() again.

ctx.isBack is indeed true: grafik

Is there anything else I should test, master branch or some PR?

dmitrylyzo commented 3 years ago

ctx.isBack is indeed true:

:eyes:

I have added debug branch in jellyfin-tizen - it fixes loading order for 10.7 and adds popstate logging (to see where popstate event was fired). FYI, some messages may be hidden in the groups defining core routes, loading installed plugins, loading packages.

Also try changing the command order here: https://github.com/jellyfin/jellyfin-web/blob/e27131edf0462c557d1c53ea4ee65fa6f4ac5b5c/src/components/appRouter.js#L618-L620 to

    ctx.isBack = this.popstateOccurred;
    this.popstateOccurred = false;
    this.handleRoute(ctx, next, route);

Dunno why I used that order. And I am not sure if changing the order will help.

Meanwhile, this will change the connection flow from the above. The down side: we probably won't know why isBack is true.

HimbeersaftLP commented 3 years ago

@dmitrylyzo Neither the debug branch (although that one did remove the console error on 10.7) nor the order change nor your branch of jellyfin-web fixed the issue.

Logs with debug branch, web 10.7 and no changes jf_tizen_debug
Debug branch, web 10.7, changed command order jf_tizen_debug_commandOrder"
Debug branch, web from your pull request's branch jf_tizen_debug_web_pull"
Debug branch, web from your pull request's branch, changed command order jf_tizen_debug_web_pull_commandOrder"

Btw: Another funny workaround I found is to plug a mouse into the TV and click the home button in the menu bar.

dmitrylyzo commented 3 years ago

[popstate] null :point_left: this causes Back.

I played around with webOS 1.2 emulator - it also fires a popstate event, but app doesn't exit because it doesn't touch the '' route (index.html without hash).

Next try https://github.com/jellyfin/jellyfin-web/pull/2668

HimbeersaftLP commented 3 years ago

Next try jellyfin/jellyfin-web#2668

Yup, that solved the issue!

dmitrylyzo commented 3 years ago

Yup, that solved the issue!

No more errors? Like these https://github.com/jellyfin/jellyfin-tizen/issues/19#issuecomment-633657382

HimbeersaftLP commented 3 years ago

Yup, that solved the issue!

No more errors? Like these #19 (comment)

The only errors I am getting are:

error checking ScrollToOptions support

error checking 'key' field

Failed to load resource: Cannot show URL file:///System/Info/Public

isUdPanelSupported() error code = undefined

Also I can't change the audio track like it has already been mentioned in other issues. It appears that video..audioTracks is always length 0: grafik

HimbeersaftLP commented 3 years ago

Meanwhile, the subtitle selection works just fine: grafik

HimbeersaftLP commented 3 years ago

Also, an AvPlay object (Samsung's own media API, I created the object using this tutorial: https://developer.samsung.com/smarttv/develop/guides/multimedia/media-playback/using-avplay.html) with the same media URL was able to find the audio tracks just fine: grafik

dmitrylyzo commented 3 years ago

Switching audio tracks is probably the main blocker.

On Tizen 3 and 4, I have audio tracks, but enabling/disabling doesn't work: https://forum.developer.samsung.com/t/how-to-change-audio-track-of-htmlvideoelement/6719

Same issue: https://developer.tizen.org/forums/web-application-development/video-tag-not-work-audiotracks?langswitch=en

In the worst case we need to make custom player using AvPlay API and push it from NativeShell.

HimbeersaftLP commented 3 years ago

Switching audio tracks also worked on AvPlay using webapis.avplay.setSelectTrack('AUDIO',2);.

I'm afraid using AvPlay is probably the only option if TVs before 2020 should be supported. (or remuxing the file server-side)