Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Tizen 2.4 #19

Open
samuel9554 opened this issue Apr 23, 2020 · 65 comments
Open

Support for Tizen 2.4 #19

samuel9554 opened this issue Apr 23, 2020 · 65 comments

Comments

@samuel9554
Copy link

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
Copy link
Collaborator

It was, but I didn't get feedback.

I suppose you are trying master branch of jellyfin-web.
I cannot guarantee, but this may help:

diff --git a/webpack.dev.js b/webpack.dev.js
index beca8ea4f..687e3d6b7 100644
--- a/webpack.dev.js
+++ b/webpack.dev.js
@@ -14,7 +14,7 @@ module.exports = merge(common, {
         rules: [
             {
                 test: /\.js$/,
-                exclude: /node_modules[\\/](?!query-string)/,
+                exclude: /node_modules[\\/](?!query-string|split-on-first|strict-uri-encode)/,
                 loader: "babel-loader"
             },
             {
diff --git a/webpack.prod.js b/webpack.prod.js
index 80d40f345..59d988fa9 100644
--- a/webpack.prod.js
+++ b/webpack.prod.js
@@ -7,7 +7,7 @@ module.exports = merge(common, {
         rules: [
             {
                 test: /\.js$/,
-                exclude: /node_modules[\\/](?!query-string)/,
+                exclude: /node_modules[\\/](?!query-string|split-on-first|strict-uri-encode)/,
                 loader: "babel-loader"
             },
             {

Apply patch to jellyfin-web (from jellyfin-web folder)

patch -p1 < saved_patchfile_from_post

This is what I noted during webOS 2 test.

@samuel9554
Copy link
Author

So what I did step by step.

Git clone https://github.com/jellyfin/jellyfin-tizen.git
Git clone https://github.com/jellyfin/jellyfin-web.git

Change in webpack.dev.js and webpack.prod.js the line
exclude: /node_modules[\\/](?!query-string)/,
to
exclude: /node_modules[\\/](?!query-string|split-on-first|strict-uri-encode)/,

cd jellyfin-web yarn install
cd jellyfin-tizen
JELLYFIN_WEB_DIR=../jellyfin-web/dist yarn install

tizen.bat build-web -e ".*" -e gulpfile.js -e README.md -e "node_modules/*" -e "package*.json" -e "yarn.lock"

change in .buildresult\config.xml
<tizen:application id="AprZAARz4r.Jellyfin" package="AprZAARz4r" required_version="3.0"/>
to
<tizen:application id="AprZAARz4r.Jellyfin" package="AprZAARz4r" required_version="2.4"/>
tizen.bat package -t wgt -o . -- .buildResult
tizen.bat install -n Jellyfin.wgt -t NAME_TV

The install was successful but again I have a black screen and nothing loading.

@dmitrylyzo
Copy link
Collaborator

dmitrylyzo commented Apr 24, 2020

It's bad that Samsung does not have an emulator for Tizen 2.x

I looked at UserAgent string for Tizen 2.4 and it probably uses WebKit like webOS 2.
This also speaks of WebKit.

Here is another fix jellyfin/jellyfin-web#1119
But webOS 2 is still not good.

@HimbeersaftLP
Copy link

It's bad that Samsung does not have an emulator for Tizen 2.x

It'd also be helpful if Tizen Studio wouldn't crash every time I try launch this program in debug mode on my Tizen 2 TV. Does Samsung even test their stuff?!

@samuel9554
Copy link
Author

Also I just realized that they won't even support CSS Flex... And what I remember to have work a little bit on the jellyfin-web repo is that we use it everywhere. So I'm starting to think that this would just be impossible. Only solution I can think of is to build a apps in C in tizen studio and use the api for those older device.

@dmitrylyzo
Copy link
Collaborator

Also I just realized that they won't even support CSS Flex...

flex might work with prefix -webkit- (which should be added automatically by babel in master jf-web branch). But looking on webOS 2 I am not sure now.

@bebbenhorst
Copy link

Hi I need Tizen 2.3 for installing jellyfin.wgt on my 2015 UJU7000 tv 15TV_STANDARD1

I got unknown platform when I try to connect.

But I cannot find the right files for it, on the samsung site I dont see any download files for 2.3

@dmitrylyzo
Copy link
Collaborator

@bebbenhorst try to change required_version in this line

<tizen:application id="AprZAARz4r.Jellyfin" package="AprZAARz4r" required_version="3.0"/>

Jellyfin is currently working on WebOS 2 emulator, so there is a good chance that Tizen 2.4 (or even 2.3) will work too.

@dmitrylyzo
Copy link
Collaborator

dmitrylyzo commented May 17, 2020

I am writing here to be closer to "2.4"

@bebbenhorst wrote #1 (comment):
I'm connected but i get unknown platform in device manager, I use the newest Tizen studio,
and i also cannot right mouse button click to permit install applications

For reference
https://developer.tizen.org/forums/sdk-ide/device-manager-unknown-platform

There is no guarantee, but maybe you have to install TV-Extensions-3.1.2
I heard somewhere that it supports 2 (https://medium.com/@ibazzva/developing-for-old-samsung-tvs-in-tizen-studio-2-x-5aa3f853db09)

TV-Extensions-3.1.2 can be taken here https://developer.samsung.com/smarttv/develop/tools/tv-extension/archive.html

@bebbenhorst
Copy link

I installed the tv extentions
image

But in the studio I cannot select it
image

on the inscrutions in here they are talking about tizen studio 2.X
I only found studio 3.7 from the website

@dmitrylyzo
Copy link
Collaborator

But in the studio I cannot select it

Same. I installed it for emulator 3.0, and it works - enough for me.
But what does device manager show now?

@bebbenhorst
Copy link

Same. I installed it for emulator 3.0, and it works - enough for me.
But what does device manager show now?

what is the meaning of emulator? just to test things?
In Device Manager is still showing the same thing , I'm connected but unknown platform and unable to permit installation.
Is there no other way to get tizen studio 2.X , download link or installation folder from someone?

If it is possible I want to deploy the wgt file to the tv but if this isn't possible due to old tizen version its unfortunate.

@dmitrylyzo
Copy link
Collaborator

dmitrylyzo commented May 17, 2020

what is the meaning of emulator? just to test things?

Yes. For example, I don't have Tizen 5 TV but can test app in emulator. I installed TV-Extensions-3 to get emulator with Tizen 3. But I didn't find emulator for 2.x and have no TV with it.

I found something https://stackoverflow.com/a/47706212

Could you try to build WGT with Tizen certificate and just install it on TV (skip Permit install...)?

@HimbeersaftLP
Copy link

Both the latest tizen studio and tv extensions work on my first gen Tizen tv, however you will need to create a Samsung developer certificate with a Tizen distributor certificate instead of both being Samsung.

@bebbenhorst
Copy link

bebbenhorst commented May 17, 2020

I Just created an wgt with an samsung developer certificate and the default tizen distributor certificate.

When I try to install I get the following message:

$ tizen.bat install -n Jellyfin.wgt -t UJU7000
Transferring the package...
Transferred the package: C:\nieuw\web\jellyfin-tizen\Jellyfin.wgt -> /opt/usr/apps/tmp
Installing the package...

Platform log view

install AprZAARz4r.Jellyfin

packet_path /opt/usr/apps/tmp/Jellyfin.wgt

install app, app_id[AprZAARz4r.Jellyfin], packet_path[/opt/usr/apps/tmp/Jellyfin.wgt], install_path[]

app_id[AprZAARz4r.Jellyfin] installing[3]

app_id[AprZAARz4r.Jellyfin] installing[23]

app_id[AprZAARz4r.Jellyfin] installing[26]

app_id[AprZAARz4r.Jellyfin] installing[34]

app_id[AprZAARz4r.Jellyfin] install failed[PKGMGR_ERROR]

spend time for wascmd is [13148]ms

cmd_ret:0
Failed to install Tizen application.
Total time: 00:01:03.158

This settings I got
image

Is the DUID maybe not right?
I got it from my tv , menu, support ,contact samsung then Unique ID : XTCC2KSD57A4W

@dmitrylyzo
Copy link
Collaborator

dmitrylyzo commented May 17, 2020

Try to remove second distributor (leave only tizen-distributor-signer).
Or create second profile: Samsung author + Tizen distributor (Public).

Currently, I am confused: I am able to install WGT with such profile, but DUID is not specified in this case. But I own Tizen 4
cert-1

Also, Permit to install application is probably not required.

  1. You don't need to execute 'Permit to install applications'.
    'Permit to install applications' is used to copy your mail-received certification to TV.
    If you use local certification, it is not needed.
    from here

@bebbenhorst
Copy link

Did remove the second Distributer Certificate and kept the tizen distributer signer but the same result:
app_id[AprZAARz4r.Jellyfin] install failed[PKGMGR_ERROR]

thanks for your help btw

@dmitrylyzo
Copy link
Collaborator

I forgot to mention: you should rebuild WGT after you change profile

@bebbenhorst
Copy link

I just did rebuild it with the new certificates but still get the error:(

app_id[AprZAARz4r.Jellyfin] install failed[PKGMGR_ERROR]

@dmitrylyzo
Copy link
Collaborator

dmitrylyzo commented May 17, 2020

I already posted this link somewhere https://developer.youi.tv/latest/Content/Tizen_DevTopics/H1BuildingInstallingAppWidgets.htm#Installa

PKGMGR_ERROR If the application is already installed on a 2015 TV, try uninstalling it first. If you are installing a Samsung signed widget to a 2015 TV, try re-signing it with a Tizen certificate instead.

Also, how much free space on TV you have? Jellyfin is big because of fonts (38-39MB)

And what firmware version?

@bebbenhorst
Copy link

I tried to install again and cleaned my jellyfin web and tizen folder and created everything again.

created my own author placed an password on it and then created an new tizen certificate.

removed the samsung distributor from the first one and added the tizen one.

created the wgt file
Author certficate: C:\Users\bebbenhorst\SamsungCertificate\tizen-cert\author.p12
Distributor1 certificate : C:\tizen-directory\tools\certificate-generator\certificates\distributor\tizen-distributor-signer.p12

but still the same pkgmgr_error

Also I downloaded the newest firmware for the tv 1.550
but the tv was allready on the newest.

If I read the discription it says use tizen certificate instead of samsung but that is what I did.
Maybe im doing something wrong?

Is it possible to ask someone else to create the certificate so i can import them to test?

TV space is like 1 gb in use and 3 in space

@dmitrylyzo
Copy link
Collaborator

dmitrylyzo commented May 18, 2020

Just to be sure, please check again required_version in jellyfin-tizen/config.xml. Should be 2.3.

<tizen:application id="AprZAARz4r.Jellyfin" package="AprZAARz4r" required_version="2.3"/>

What else can be done?
Unplugging TV from power.

Also I downloaded the newest firmware for the tv 1.550
but the tv was allready on the newest.

Installation via USB was available until 1412 (I read somewhere). So not an option.

TV space is like 1 gb in use and 3 in space

🤤 my NU7400 cannot provide much free space

@bebbenhorst
Copy link

@dmitrylyzo Thanks a million! When I eddited the config file to 2.3 it worked with installing :)

@samuel9554
Copy link
Author

@dmitrylyzo Thanks a million! When I eddited the config file to 2.3 it worked with installing :)

Are you able to use the application on the tv? Or you get black screen?

@bebbenhorst
Copy link

It is working in the tv , got normaal screen and van play movie ect

@samuel9554
Copy link
Author

Guys we need to build a steep by steep for me also. My tv is a 2.4

@bebbenhorst
Copy link

What I did was following the instructions in the wiki , and instead of Samsung certificate I replaced it with An Tizen certificate.
Further I changed the application required_version to 2.3 and build it.

@dmitrylyzo
Copy link
Collaborator

Guys we need to build a steep by steep for me also. My tv is a 2.4

Wait a bit, jellyfin-web seems broken - I will make a quick PR.
As an experiment, try NOT to install TV-extensions-3 first - it probably need for debugging.

@T-bond
Copy link

T-bond commented Jan 5, 2021

The problem still occurs with 10.7 RC 1 10.8.5.
A workaround is to use the Jellyfin app on your phone / browser, connect to the running app on the TV with the Screen cast button, and set Display mirroring on, and navigate to a media file for example.
After this, the app on the TV should work without an issue, until closed.
You have to do this dance with a phone or another browser app every time you open Jellyfin on a 2.4 Tizen TV, but after this, it is usable.

@pixelomer
Copy link

I am also having the issues described in this thread. The app works on first run but after opening it for a second time, the application starts on the "Do you want to exit" screen and saying no to that question gives you an empty homescreen. No buttons work except for the back button which takes you back to that screen.

A workaround is to use the Jellyfin app on your phone / browser, connect to the running app on the TV with the Screen cast button, and set Display mirroring on, and navigate to a media file for example.

After this, the app on the TV should work without an issue, until closed.

This workaround seems to work for me as well. After navigating somewhere using a remote device, the app just starts working again.

@jllodra
Copy link

jllodra commented Apr 18, 2021

I'm on 2.4 Tizen TV too and I also have this problem of "only works in the first run". It is really annoying.

I have not much idea on how to use Tizen Studio, but if anyone can point me into the right direction I can spend some time debugging this, so the developers could fix it?

Could it be related to serviceworker? (it works the first time but the next time there might be some problem with the sw)

Edit: I commented out all code related to serviceworker but still the same issue.

@dmitrylyzo
Copy link
Collaborator

@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
Copy link

HimbeersaftLP commented May 8, 2021

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

@HimbeersaftLP
Copy link

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

@dmitrylyzo
Copy link
Collaborator

dmitrylyzo commented May 8, 2021

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

  • I don't like the line with apploader.js. And I know why it is there: main.bundle.js is in body for 10.7, but in head for master 🤦 PR is coming...
    At least this shouldn't be a problem - tizen.js is added anyway. But in wrong order 🤔

  • error checking ScrollToOption support can be skipped - this is the log in the catch block.

  • error checking 'key' field can be skipped - this is the log in the catch block.

  • GET file:///System/Info/Public Cannot show URL - It tries the current location as the server URL. This shouldn't be a problem, I guess. I have the same on Tizen 3/4, but it is better to filter the file protocol in apiclient site.js in web.

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 😕 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
Copy link

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
Copy link
Collaborator

ctx.isBack is indeed true:

👀

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
Copy link

@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
Copy link
Collaborator

[popstate] null 👈 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 jellyfin/jellyfin-web#2668

@HimbeersaftLP
Copy link

Next try jellyfin/jellyfin-web#2668

Yup, that solved the issue!

@dmitrylyzo
Copy link
Collaborator

Yup, that solved the issue!

No more errors? Like these #19 (comment)

@HimbeersaftLP
Copy link

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
Copy link

Meanwhile, the subtitle selection works just fine:
grafik

@HimbeersaftLP
Copy link

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
Copy link
Collaborator

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
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants