Hi!
I’m trying put video text tracks. It works on my web host, but dont works on local computer, both - same examples. Why?
Local computer:
code: codepen
all files: github
PS. What a song in viper.mp3?
Assessment Page: Video and audio content
Hi!
I’m trying put video text tracks. It works on my web host, but dont works on local computer, both - same examples. Why?
Local computer:
code: codepen
all files: github
PS. What a song in viper.mp3?
Assessment Page: Video and audio content
Hello @VladimirK
you doing great well done
for the issue that it does not work on your local machine
try the following right click on any part of the page then inspect it will open the developer tool go to the console you would see an error i guess it will be cors error
you can disable it but it not recommended or you can install a server app on your local machine then run it throw the server
i do not know
and have a nice day
Hi @VladimirK
I downloaded the code from your Github project and run it locally and I can see the subtitles:
@justsomeone CORS shouldn’t be a problem as all files (including the subtitles) are local.
But looking at the console is definitely a good advice. At the moment I have no idea why it is not working at your end
The song is “Horned Viper” by “Conquest of Steel”. The creator of this MDN page was their drummer back then
Happy coding!
Michael
thanks @mikoMK for correcting me but i get weird error on the console while i tried to run it locally
`
Security Error: Content at file:///path to /index.html may not load data from file:///path to/subtitles_ru.vtt.
All candidate resources failed to load. Media load paused.
`
i even tried to create new profile and still get the same issue
i am using firefox 91.0.2 on linux
That is interesting! I’m using Firefox 92 Developer Edition. When I switch to Firefox 91 or even Firefox 92 Beta I also see this error. There seems to be a difference in configuration that allows references to local files in the Dev Edition.
and the error message does not give more details about it
will try with any chrome based browser and see if i get more details
I dug a bit deeper.
It is possible to make the example work locally by going to about:config
and setting privacy.file_unique_origin
to false
.
But be aware: This should only be temporary because it disables the “same-origin policy” which is an important security measure.
The better solution is using Firefox Developer Edition where this is still enabled but there seems to be an exception for local files. I couldn’t find any information about it, but apparently it works.
What still escapes me is the fact that loading a file from local to local isn’t qualified as same-origin. Maybe it’s a security risk if an attacker sends a HTML file by email which reads out local files and sends them back.
in chromium browser it give this error
urls are treated as unique security origins vtt
thanks for that info @mikoMK well done
Thanks guys for attention!
I have error on Firefox 91.0.02:
And on Chromiun 95.0.4608.0 (Developer version):
It’s nice that you found the reason for this. I will use Firefox 92 Developer Edition in such cases.
@justsomeone and me talked a bit more about the topic and we found out it is not the Firefox Developer Edition itself, but another config option that I apparently switched off some time ago.
about:config
security.fileuri.strict_origin_policy
targets specifically local files (file:///) and when set to false
will allow the loading of the subtitles. It defaults to true
.
Where I was right was
This problem was fixed in bug Bugzilla 1558299 and the config switch security.fileuri.strict_origin_policy
was introduced to help developers with exactly the problem discussed in this topic.
Michael