Trying to add subtitles but I get an error message

Viewed 26

I have an mp4 file I wish to put into an HTML file and there are subtitles that accompany it. I am very new to web coding so I am unfamiliar with this error and I've already tried a few things. I have tried to add the crossorigin tag set to true and something else but then the video itself doesn't even show up. Here is the exact error: "Unsafe attempt to load URL file:///D:/Projects/05-Practice/videos/avatar_en.vtt from frame with URL file:///D:/Projects/05-Practice/index.html. 'file:' URLs are treated as unique security origins." And this is the code I have so far:

<video controls>
    <source src="videos/avatar.mp4" type="video/mp4">
    <track kind="subtitles" src="videos/avatar_en.vtt" srclang="en">
    <p>Error when loading video.</p>
</video>
0 Answers
Related