Closed alundgard closed 5 months ago
The transcript isn't loading in Firefox for me either, although I do see it in Chrome. Also the video itself is not loading either.
The transcript isn't loading in Firefox for me either, although I do see it in Chrome. Also the video itself is not loading either.
It works fine for me in Firefox.
That is good to hear.
Oddly enough it is now working for me in Firefox. And also in Safari although I do see the text track cross origin error.
Adding notes:
https://purl.stanford.edu/qf378nj5000
-Transcript loads intermittently in Firefox i.e. worked fine in private window even after hard refresh. Worked fine in regular window the first time, but stopped after hard refresh.
Error examples (from browser stack trial using windows and Firefox).:
Loading module from https://ga.jspm.io/npm:@videojs/vhs-utils@3.0.5/es/ was blocked because of a disallowed MIME type (text/html).
iframe
Loading module from https://ga.jspm.io/npm:three@0.157.0/ was blocked because of a disallowed MIME type (text/html).
iframe
Loading module from https://ga.jspm.io/npm:@lit/reactive-element@1.6.3/decorators/ was blocked because of a disallowed MIME type (text/html).
iframe
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ga.jspm.io/npm:@videojs/vhs-utils@3.0.5/es/. (Reason: CORS request did not succeed). Status code: (null).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ga.jspm.io/npm:three@0.157.0/. (Reason: CORS request did not succeed). Status code: (null).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ga.jspm.io/npm:@lit/reactive-element@1.6.3/decorators/. (Reason: CORS request did not succeed). Status code: (null).
From Firefox on Mac:
GET
https://ga.jspm.io/npm:@videojs/vhs-utils@3.0.5/es/
GET
https://ga.jspm.io/npm:@lit/reactive-element@1.6.3/decorators/
GET
https://ga.jspm.io/npm:three@0.157.0/
Loading module from “https://ga.jspm.io/npm:@videojs/vhs-utils@3.0.5/es/” was blocked because of a disallowed MIME type (“text/html”).
[iframe](https://embed.stanford.edu/iframe?url=https://purl.stanford.edu/qf378nj5000&_v=1704721322)
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ga.jspm.io/npm:@videojs/vhs-utils@3.0.5/es/. (Reason: CORS request did not succeed). Status code: (null).
Loading module from “https://ga.jspm.io/npm:three@0.157.0/” was blocked because of a disallowed MIME type (“text/html”).
[iframe](https://embed.stanford.edu/iframe?url=https://purl.stanford.edu/qf378nj5000&_v=1704721322)
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ga.jspm.io/npm:three@0.157.0/. (Reason: CORS request did not succeed). Status code: (null).
Loading module from “https://ga.jspm.io/npm:@lit/reactive-element@1.6.3/decorators/” was blocked because of a disallowed MIME type (“text/html”).
[iframe](https://embed.stanford.edu/iframe?url=https://purl.stanford.edu/qf378nj5000&_v=1704721322)
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ga.jspm.io/npm:@lit/reactive-element@1.6.3/decorators/. (Reason: CORS request did not succeed). Status code: (null).
From Safari on (my local) Mac, for "Women at Stanford" which does load the transcript
[Error] Failed to load resource: the server responded with a status of 404 () (npm:three@0.157.0, line 0)
[Error] Failed to load resource: the server responded with a status of 404 () (es, line 0)
[Error] Failed to load resource: the server responded with a status of 404 () (decorators, line 0)
[Error] Failed to load resource: the server responded with a status of 403 (Forbidden) (playlist.m3u8, line 0)
@hudajkhan those errors are unrelated. That is due to import-map 2.0.0. The problem occurred before that was merged in.
Thanks @jcoyne ! I was trying to look at what errors are occurring when it doesn't seem to work and when it does. I was wondering if this warning
"VIDEOJS:"WARN:"
"Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
This may prevent text tracks from loading."
is the issue, but I get this warning when the page works for me in Safari. Will keep digging.
For reference, the documentation includes this section: https://videojs.com/guides/text-tracks/#text-tracks-from-another-domain.
After analysis and help from @alundgard and @andrewjbtw , we realized that this error is a different manifestation of #2062 with the added wrinkle of OS level caption settings.
In summary:
(a) In Safari, videojs text tracks do not have cues loaded for any track that is not already selected in the video player. Our transcript code retrieves all the cues for the different caption tracks and loads them when the video player has dispatched events indicating some level of readiness. Unfortunately, in the case of Safari, while the code can see caption tracks even if they are not selected in the video player itself, the cues are not available.
(b) There are OS settings on Macs that will determine if a caption is selected by default in the video player. Alan and Andrew tested out the settings and found when the Accessibility "Prefer closed captions and SDH" setting was turned off, the video player had no captions selected by default. In that case, the transcript would not load. When they turned the setting on, a caption file was selected by default and the transcript would load in the sidebar.
I have been searching for a mechanism whereby we could programmatically select the caption files and/or extract all the cues by changing track modes to "showing" or "hidden" instead of "disabled". Unfortunately, I haven't found a solution yet.
One approach to try for single tracks is to see if adding "default" to the track will help select that track even if the OS settings have "prefer closed captions and SDH" turned off.
What I tried and what seemed to work in Safari:
I'll be setting up a PR with (1) to address the single track issue in Safari. I wasn't able to find a solution yet for #2062 .
The only other approach I can think of that may work for Safari is to bypass videojs and read in the caption using WebVTT directly (for the transcript). I would have to explore that approach.
Testing out the pull request branch on staging:
Testing this out on safari for an item with multilingual captions https://sul-purl-stage.stanford.edu/wm783fb6812: When the video first loads, English is selected in the video caption list. The English transcript is visible in the sidebar, and the highlighting and auto-scrolling work correctly.
When Russian is selected in the video, the highlighting no longer works in the transcript. This is an additional error in the multilingual caption situation.
For a video like https://sul-purl-stage.stanford.edu/pf759xf5671, there is only one language and the transcript loads fine. When captions are turned to off though in the video itself, the transcript highlighting and autoscrolling no longer work.
In Safari only, the Sidebar transcript tab does not load.
PURL Examples:
Console logs:
"Failed to load resource: the server responded with a status of 403 (Forbidden)" from https://sul-streamengine-prod.stanford.edu/stacks/...
"VIDEOJS: WARN: Text Tracks are being loaded from another origin but the cross origin attribute isn't used. This may prevent text tracks from loading."
In Firefox and Chrome, the Sidebar transcript tab loads as expected.![Image](https://github.com/sul-dlss/sul-embed/assets/2343316/4f961cc7-2f3d-4b0a-b7e1-0976adc50598)