-
Notifications
You must be signed in to change notification settings - Fork 11
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
HTML5X Plugin subtitles styling on UWP #13
Comments
Hey, Thank you for the hint. Please note that the HTML5X plugin does not yet implement subtitle styles (only the platform-dependent standard styles are displayed, as you already mentioned). For UWP devices, I recommend testing your HTML5X plugin on the Microsoft Edge browser and checking/debugging whether your subtitle styles are displayed correctly. I would really appreciate it if you would also share your plugin project on GitHub, then I would definitely take a look at it. Best regards, |
Thank you for the explanation. Just to understand it correctly: You have downloaded the html5x.html, the html5x.js, and the common.css files, put them on your server and are now trying to load them via MSX? But only the HTML and JS files are loaded and not the CSS file? Sounds to me like the CSS file is incorrectly referenced in the HTML file. Would it be possible to send me a test link to the hosted HTML5X version so I can take a look? Regarding the UWP debug mode: Unfortunately, I cannot currently test the MSX UWP version because I no longer have a suitable device. That is why I cannot simply activate the debug mode without testing it first. I would also not like to activate the debug mode in the production version (rather in a separate test version). |
I got your html5x.html, changed the relative links to full links to your server for JS files and to mine for common.css, got the common.css, added some changes to see if it even works, uploaded html5x.html and common.css to my server and tested it in MSX. When I use the web MSX version, it loads html5x.html and then common.css. When I try UWP MSX, only http5x.html is loaded from my server. Since the player works, JS files are loaded properly from your server. When I embed styles in the html file, they are also ignored (but I don't have a way to tell that since I can't see the webview console). When I open my html5x.html in Chrome, all files and styles are loaded properly from the correct places which can only mean that it's the webview that fails to load the styles both from your server and mine (and any other).
I can give you access to a Windows 11 VM if you are willing to assist me with this. |
Thank you for the further explanation, now I understand everything. Also thank you for providing a VM access, but I think we will be able to solve this issue without it.
If even that does not work, it seems that the Microsoft Edge browser used for UWP devices does not support CSS subtitle styles. I have now uploaded a second HTML5X plugin ( Usage: |
Thanks for testing the new plugin. I think we have already gained a lot of insight into the problem. Can you please tell me which browser version is used on your UWP device (Settings → About → User Agent)? UPDATE: I now have a way to test the UWP version. On a Windows 10 Pro machine, the current MSX UWP version uses an Edge/18.19045 build. Therefore, the |
Mine are Edge/18.22631 on Windows and Edge/18.25398 on Xbox and both have the problem. I think it's still possible to apply custom styles if the actual element is known, but it will be a workaround anyway, probably temporary if it works as expected for the older version. |
Let's pick this up once again. I've built a version of your html5x that supports styled subtitles, here it is in the testing branch, used as That's not the problem though since I was testing the build with your example from here and it was perfect, but when I switched back to my main source to finally be satisfied with the results -- nothing happened. Turns out I was mixing up HLS streams with ordinary MP4 files, HLS streams are not supported by Chrome, Firefox won't allow me to disable CORS for testing. I can only test this combo of HLS and html5x on Xbox and in Safari. In Safari it actually works as expected, on Xbox it does not show any captions at all (meaning the ordinary ones get disabled by the player but the replacement is missing somewhere). It may also be cached, I'll see if that's the case. Which technology is used as a webview for UWP builds? I'd still like some debugging, not sure how to work this out on Xbox though unless you'll provide some testing build for the developer mode. If it's something old, would you consider switching to the more recent engine? I also previously figured the reason html5x is the only plugin to support subtitles is the technical limitations of all the rest, but now I look at hls.js and see that it supports such function. I'll try to extend either hls.js or video.js (or both) with subtitles support, maybe they will be more cooperative on this matter. |
Thank you for picking up this topic again. Nice work with the
I am using a JavaScript UWP project template that has already been deprecated. The app package only contains HTML, CSS, and JS (no C# wrapper code is involved). I am not sure if a debug package version would even be possible with this approach.
I have already thought about switching to the new UWP WebView2 approach. However, currently I do not have the time and the motivation to start something like this, especially because the old approach has worked well so far.
I have also thought about adding subtitle support to various plugins, since almost all of them support subtitles. However, this will take longer, as every implementation is different and would have a long trial and error phase (especially if subtitle styling should also be available). Here, too, I do not have the time and the motivation to start something like this right now. However, I would be happy to assist you with potential implementations and to answer any question. |
Thanks for your responses, I don't think there's anything I can't fix myself apart from bumping a browser version on UWP (but targeting Chrome 70 is still necessary for crossplatform compatibility with cheap trash TVs, I guess). I only really need UWP to run on Xbox to use it as a stream player, the alternative would be Kodi, it's more functional overall but it's also too much for a simple grid, couple of buttons and a player. I guess I'll try to copy your approach to audio tracks and subtitles from html5x to hls.js, merge it with my styling and see if it will work with HLS streams in Chrome and later on other platforms. I'll post it here once it comes together. As a side question about formatting I'd like to understand why do I have issues with templates in pages, I only want to place equal buttons one after another but the only error I get when I try to copy your approach is that there's no content or nothing is selectable. I've resorted to an ugly solution here, line 57, but I'll appreciate if you'll point me in the right direction to make it work with a template. |
I guess I finished the job with html5x(s) upgrading, I left some notes in the readme to better understand the context. I've been able to debug the plugin with ajax since all other methods were not leaving any messages, turns out the Xbox browser engine would load only one cue at a time for a stream unlike Safari where all the loaded cues are always available. The subtitles were actually working, they were just never been able to trigger since it's already too late to show anything. This mod works just fine with VTT and the MP4 test file in Chrome, I believe it will also work on the majority of other platforms except UWP. When the remote MP4 file is loaded in UWP, the player just rejects it, maybe it's a strict CORS policy of the webview. I pushed the last update, I will redirect my efforts to hls.js and see if it will process cues in a more predictable way |
Very good job on the plugin and the description. A few notes on CORS in this context: When I was developing the |
For templated items, you can use the |
Back at it again. I upgraded your hls.js to support both audio and text tracks, it's now live here. The problem is that this didn't help a single bit to let me use the subtitles on xbox. Well, by default hls.js would wrap around default I've tried to run MSX in IE11 to see if your webview is that -- it is not. However, since we previously discussed that it's an outdated technology, I finally realized that there were times back until 2021 when Edge was using EdgeHTML and not Chromium. Edge on Xbox moved to Chromium later on, but as it always happens with Microsoft -- the remains are still there. I believe that your build still is based on EdgeHTML version of Edge that was undercooked the whole way and that's why it's so complicated to achieve what I want. At this point I have no way to debug and fix this, this will require a whole custom player that will be compatible with prehistoric browsers and I haven't seen a good one yet. I'd also like to ask you to take a look if it will be possible to move to WebView2 at some point in the near future. Also, do you accept donations in crypto? |
Nice, once again very good work on the plugin. I have just tested your Could you please re-check if your Finally, some answers/comments to your questions/remarks.
Yes, I think so too.
I have added it to the list of possible extensions.
No, currently I do not have a crypto donation wallet. |
Agreed, this configuration menu does not look good. I still can't figure out the templates there though, maybe I'll rework it completely when I'll be making hls.js version to support customizable subtitles, but that'll happen once subtitles start working on Xbox.
Yep, it works now with fixed CORS and static files. HLS, however, is another story.
Maybe it's time to make one? |
An important hint here would be that templated items all have the same size within the content root object. If different item sizes should be displayed (as is the case right now), the template object cannot be used.
Great, this is good news.
I will think about it. |
Hey,
There's an issue with subtitles styles on UWP devices. When enabled, captions are displayed with a default style (tiny black Times New Roman) instead of the expected large white font like other platforms.
I've attempted to fix it manually by cloning the plugin and updating styles, it seems that the webview does not even attempt to load common.css and ignores any styles in the html file itself.
I can't investigate this any further because the webview debugging is not enabled, but you can enable it in the next build and I'll take a look myself.
Thanks!
The text was updated successfully, but these errors were encountered: