+ 20
How to add subtitles to video in sololearn?
I added subtitle but not showing in sololearn please help me to find Error. below is my code 👇👇 https://code.sololearn.com/W5OJq1b65she/?ref=app
7 Respuestas
+ 11
Muhd Khairul Amirin Bin Yaacob your article is not helpful bro
+ 11
Subtitles is clearly showing in iPhone iOS 12.1
then why not showing in Android?
+ 5
I expect Muhd was trying to tell you that it's the cross-origin resource sharing that may be an issue here; I expect that may not be something you can fix in the sololearn environment (someone, correct if I'm wrong - I'm pretty new to this environment and don't know its limits yet). Since you are restricted to CSS, JS, and HTML, a workaround that might work would be to inline the VTT file (not optimal, but it gets around the CORS issue).
By that, I mean, instead of an http: URL in the src, use a direct data: url. (ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs)
With your code, that would be:
<track kind="subtitles"
label="English"
srclang="en" default
src="data:text/plain;base64,V0VCVlRUCgowCjAwOjAwOjI4LjEw..." />
... well, I gave it a try but it didn't work. If you save the VTT file in the same place as the HTML file, it loads and displays fine, but there doesn't seem to be a way to make a resource file in the code.sololearn space other than HTML/CSS/JS for a website.
- 1
weeeeeeeoooow
- 2
lol
- 7
challenge me in HTML