Closed dmitrylyzo closed 4 years ago
The trick with passing object into iframe didn't work for Tizen - object defined, but its content is not. CORS I think. So, this works in webOS 3/4 emulator, but who knows how it will be on real TV or webOS 5. In worst case, adapter injecting and postMessage will be required - this works for Tizen.
I wonder if this would be allowed by LG, but we'll cross that bridge when we get there.
A possible solution (if scrollbar should be hidden) is to add in
jellyfin-web
something like:
I think we can add this override in jf-web by inspecting if injected webOS
object is defined somewhere, is that possible?
I think we can add this override in jf-web by inspecting if injected
webOS
object is defined somewhere, is that possible?
I tried to load webos.css
(new file with mentioned style), if there is webOS
. But load
event fired after onAppReady
(site.js
) - too late. Sometimes it works, but it is not reliable.
In Tizen it is always late.
I did not find the "right" way to capture DOMContentLoaded
of frame document. I have something that works, but it looks weird.
Yeah, doing it in setInterval()
was my idea as well. This is certainly a workaround, but nothing too bad IMHO. So we should be able to use JS to add this CSS rule override to scrolling area if we detect presence of webos
object, IMHO.
a32e355 (simplified this a bit)
Important note (also added in the first message) After loading JF (in the frame), you cannot return to the server form (for example, to change server) without restarting the application.
you cannot return to the server form (for example, to change server) without restarting the application
Do you have any idea why? unrelated note: why don't you join us on matrix?
Do you have any idea why?
Because I "exit app" (webOS.platformBack
in jellyfin-web
) when no "go back" remains (we are on home page - appRoute.canGoBack
).
Navigation now (if the corresponding PRs are merged) Returning from the login page (transparent) requires some extra changes in jf-web.
I tried to implement a minimal NativeShell
- almost exact copy of "expo".
AppInfo.deviceId
?webOS
object will be gone, need to look at something else to insert CSS. (NativeShell + browser.web0s)?If we go NativeShell-way, then PR with "Go back" can be simplified a bit - drop webOS related lines.
Navigation with webOS-wrapper or NativeShell
In fact, as it was before (or so).
webOS-wrapper is an injected object with platformBack
function that sends message to the top window.
Returning from the login page (transparent) requires some extra changes in jf-web.
- Since
webOS
object will be gone, need to look at something else to insert CSS. (NativeShell + browser.web0s)?
We can ship our own copy of webOS.js
which defines webOS
object within jf-web, and enable it either by detecting a user agent or when explicitly asked by appending some special suffix to the URL
@JustAMan This PR can create problems for those who have frame-restrictive proxies - https://github.com/jellyfin/jellyfin-web/issues/675#issuecomment-578449850 I already thought of making a Tizen app on a similar principle (for myself, I call it a "launcher"). And now I doubt it.
@dmitrylyzo why do you doubt it?
@dmitrylyzo why do you doubt it?
Someone could just deny frames, and then app won't work.
That would be their problem, no? :) Jumping through lots of extra hoops feels too much here. I imagine there would be rather low amount of users who would use a TV connecting to a remote JF server over public Internet, and making a reverse proxy configuration which denies iframes publicly but allows them on your LAN is relatively easy.
Tried to add backward compatibility. Version 10.4.3 does not have TV-friendly features added in master. So, this is only to restore history navigation. Both methods work, but with some remarks.
or
I think getting back to the WebOS menu from the home screen is a nicer (and more expected) experience than getting back to the server input form.
Other apps act that way, as well, and people are more likely to want to get back to the home menu than to change server often.
Imo, adding a "Change server" entry to the user menu on WebOS that would bring the user back to the initial form is a better solution for that use case.
In jellyfin-web
there is multiserver
feature - show "Change Server" button on login page and "Select Server" button in profile settings. It opens selectserver page - this works for app with bundled web (Tizen, Android). This also works in a webOS app, but we will never return to the first form.
We can add some feature (or other way) to indicate that selectserver should be performed by app and NativeShell.AppHost.changeServer
function to open native selectserver page. Then I should implement NativeShell
(its minimal form is complete).
I'm fine with any way of adding ability to choose a server, but I think showing app's page is slightly better because it allows user to change what they set and then set a "remember this address" checkbox.
Switched to NativeShell
.
Supported features were taken from what was previously reported. displaymode
is excluded - we are on TV.
Same as above, only a little more detailed.
Requires PR https://github.com/jellyfin/jellyfin-web/pull/755
In my opinion, only a question of support for Jellyfin 10.4.x and below is remained.
I think we can safely assume that no it will ship with 10.5 and 10.4 is not supported. We can even add a check in the current manifest download on the webOS side.
I think we can safely assume that no it will ship with 10.5 and 10.4 is not supported.
I tried to add backward compatibility to the app here, but this is to much for single version which will be replaced soon (I hope). If support for 10.4 will be required, it is easier to add "Back" handling to web instead.
For now, I think with PR https://github.com/jellyfin/jellyfin-web/pull/755 it is ready for use with "nightly".
Just to let you know
While I was trying to solve keyboardnavigation
+input
conflict, I discovered some system events:
These events aren't sent to the frame. They are not in use.
Did you test this on webOS 4.1? (2018 OLEDs) Otherwise I'll give it a go tonight. Code looks good.
I have only emulators. I tested 3.0 and 4.0
Alright I'll do it tonight (GMT+1).
Alright so of course part of the CacheStorage
appStorage.js stuff is broken on non https endpoints. But the app does not seem to care that much. There is a (very ugly) scrollbar sadly. There is still some focus element wonkyness but it's much better already.
The detail page does not display correctly though.
(With is the 20200205 nightly). Most of these will be fixed in web I believe, but the icons are still a mess.
This PR requires "Go back" handling in
jellyfin-web
and have no backward compatibility. Perhaps backward compatibility can be added by checking the version less than 10.5.0 and performinghistory.back
on framecontentWindow
.Opening Jellyfin in iframe fixes scrolling issue in webOS 3. But then handling of "Back" button in iframe is broken. So, we have to handle it manually (almost finished).
Also, in this PR I pass ~
webOS
~NativeShell
object intojellyfin-web
to be able to "exit" in platform-specific way.Inject CSS to hide scrollbar.
~Some flaws~ ~A vertical scrollbar appears. Adding
scrolling="no"
to iframe makes it unscrollable by wheel (but scrollable by ScrollManager). A possible solution (if scrollbar should be hidden) is to add injellyfin-web
something like:~~But non-app TV-layout users will be affected too.~
~Important note After loading JF (in the frame), you cannot return to the server form (for example, to change server) without restarting the application.~