Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML HTML Video and Audio (Retired) Captioning Video The Track Element

after adding the track in my html file, I got a "crossorigin attribute" error when running the web page.

I check the console and it show me an error as below

Text track from origin 'file://' has been blocked from loading: Not at same origin as the document, and parent of track element does not have a 'crossorigin' attribute. Origin 'null' is therefore not allowed access.

Can someone help me out?

2 Answers

Kris Phelps
Kris Phelps
7,609 Points

There are lots of security rules around accessing files from the local filesystem on your computer. This makes sense if you think about it, or else any website you went to could start trying to crawl your computer's files and access the data in them.

Have you tried uploading everything to a WorkSpace and see if you have the same problem?

Malith Senanayake
Malith Senanayake
12,488 Points

I encountered the same problem. Follow this link "http://stackoverflow.com/questions/23256830/crossorigin-errors-when-loading-vtt-file" in stackoverflow where you'll find some useful information about the nature of this problem . I followed a simple trick to overcome this situation. I saved all the files in htdocs folder of XAMPP and opened it in the browser as an XAMPP document, and subtitles appeared in the video.