W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > October to December 2014

Re: Showing captions on local drive in Webkit

From: Terrill Thompson <tft@uw.edu>
Date: Thu, 13 Nov 2014 08:54:19 -0800
Message-ID: <CAC7M+woNoPcC5dgC_0sQvCB4gngJa1X3XgA4UJOryJq3HNMN8A@mail.gmail.com>
To: Oscar Cao <oscar.cao@live.com>
Cc: "Foliot, John" <john.foliot@chase.com>, "w3c-wai-ig@w3.org" <w3c-wai-ig@w3.org>
I don't think CORS really applies in this case since it's not a
cross-domain issue - the WebVTT file is on the same domain as the HTML file
that's making the request (both files are stored in the same local
directory). The error message suggests otherwise, but I still think this is
a bug:
 "Not at same origin as the document"

>From my perspective the WebVTT file *is* at the same origin as the
document.

Anyway, I found that the solution in Chrome is to launch the browser with
the allow-file-access-from-files option enabled.

Here's a web page explaining how to do this in Windows and Linux:
http://www.chrome-allow-file-access-from-file.com/

And here's how to do it on a Mac:
http://blog.derraab.com/2013/05/30/start-google-chrome-with-local-file-access-on-mac-os-x/

Thanks!
Terrill




---
Terrill Thompson
Technology Accessibility Specialist
DO-IT, Accessible Technology Services
UW Information Technology
University of Washington
tft@uw.edu

On Wed, Nov 12, 2014 at 2:38 PM, Oscar Cao <oscar.cao@live.com> wrote:

>  From personal experience of working with chrome they don't let you
> access files locally (I.e. Clicking the html file in windows explorer and
> viewing it.)
>
> Try viewing the page under a web server even if its a local server. (I.e.
> Http://localhost/)
>
> Regards
> O.
>
> Sent from my Windows Phone
>  ------------------------------
> From: Foliot, John <john.foliot@chase.com>
> Sent: ‎13/‎11/‎2014 9:23 AM
> To: Terrill Thompson <tft@uw.edu>; w3c-wai-ig@w3.org
> Subject: RE: Showing captions on local drive in Webkit
>
>   CORS settings:
> https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes
>
> (related:
> https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS)
>
>
>
> JF
>
>
>
> *From:* Terrill Thompson [mailto:tft@uw.edu]
> *Sent:* Wednesday, November 12, 2014 12:46 PM
> *To:* w3c-wai-ig@w3.org
> *Subject:* Showing captions on local drive in Webkit
>
>
>
> Hi All,
>
> I'm getting an error in Webkit browsers when I try to add WebVTT captions
> to an HTML5 video on a local drive. Here's the code:
>
> <video controls>
>
>   <source src="test.mp4" type="video/mp4">
>
>   <source src="test.webm" type="video/webm">
>
>   <track kind="captions" src="test.vtt" srclang="en" default>
>
> </video>
>
>  All test.* files are located in the same local directory as the HTML
> file.
>
> The caption file validates according to https://quuz.org/webvtt/
>
> Local captions play fine in both Firefox and IE11.
>
> However, in Chrome, Safari, and Opera the video plays fine but there are
> no captions. The following error appears in the console:
>
> > 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.
>
> The captions play fine in these same Webkit browsers if all content is
> hosted on a web server.
>
> I'm assuming this is a bug since the assertion "Not at same origin as the
> document" is false. Is there any reason to think otherwise? Do local WebVTT
> files pose any security risks that WebVTT files on a web server don't? Does
> the crossorigin attribute really have any role in delivering captions?
>
> My use case is teaching students to add captions in a web design course.
> They don't have convenient access to a web server but they can add HTML5
> video to a web page on their local drive and instantly view the results in
> any browser. However, unless there's a workaround they apparently can't do
> the same with captions.
>
>
>
> Thanks,
> Terrill
>
>
>
> ---
> Terrill Thompson
> Technology Accessibility Specialist
> DO-IT, Accessible Technology Services
> UW Information Technology
> University of Washington
> tft@uw.edu
>
> This transmission may contain information that is privileged,
> confidential, legally privileged, and/or exempt from disclosure under
> applicable law. If you are not the intended recipient, you are hereby
> notified that any disclosure, copying, distribution, or use of the
> information contained herein (including any reliance thereon) is STRICTLY
> PROHIBITED. Although this transmission and any attachments are believed to
> be free of any virus or other defect that might affect any computer system
> into which it is received and opened, it is the responsibility of the
> recipient to ensure that it is virus free and no responsibility is accepted
> by JPMorgan Chase & Co., its subsidiaries and affiliates, as applicable,
> for any loss or damage arising in any way from its use. If you received
> this transmission in error, please immediately contact the sender and
> destroy the material in its entirety, whether in electronic or hard copy
> format. Thank you.
>
Received on Thursday, 13 November 2014 16:54:48 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 13 October 2015 16:21:53 UTC