Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error adding external ttml captions file after load. #821

Closed
ewosleger opened this issue May 18, 2017 · 12 comments
Closed

Error adding external ttml captions file after load. #821

ewosleger opened this issue May 18, 2017 · 12 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@ewosleger
Copy link

Shaka v2.0.8
We noticed Shaka is displaying our captions in reverse order from our embedded ttml files in the manifest:
"jumped over the fence"
"Quick brown fox"

We have external caption files also so I am trying to addTextTrack() to the player:
player.load(_globalSelf.manifest).then(function() {
parent.messageService.dispatch(ShoMediaNotifications.PLAYER_READY, null);
if(typeof parent.params.dash_ttml !== 'undefined'){

  this.player.addTextTrack(parent.params.dash_ttml, 'eng','caption','text/ttml');
}

}).catch(_globalSelf.onError);

player errors out: tb[b] is not a constructor.

@ewosleger
Copy link
Author

Regarding our captions in reverse order. A snippet of a specific ttml segment.
<p begin="00:00:55.000" end="00:00:56.541" region="pop1" style="basic" tts:extent="45% 5.33%" tts:origin="27.5% 79.33%"> JEANNIE: <span tts:fontStyle="italic">You still</span> </p> <p begin="00:00:55.000" end="00:00:56.541" region="pop2" style="basic" tts:extent="67.5% 5.33%" tts:origin="15% 84.66%"> <span tts:fontStyle="italic">stubbornly insist on being</span> </p>

The first <p> "pop1" tss:origin y cord is 79.33% from the top.
The secons <p> "pop2" tss:origin y cord should be below "pop1" y at 84.66% however it is rendering above the first <p>.

screen shot 2017-05-23 at 2 18 41 pm

@ismena
Copy link
Contributor

ismena commented May 23, 2017

Hi @ewosleger,
Please correct me if I misunderstood: looks like you are reporting 2 separate issues:

  1. Captions showing up in reverse order
  2. External text track not being loaded
    Is that right?

Regarding the first one (captions in reverse order), could you tell me if the 'tts:writingMode' attribute is present on the segment and what it's value is if yes.

@ismena ismena added status: waiting on response Waiting on a response from the reporter(s) of the issue and removed needs triage labels May 23, 2017
@ewosleger
Copy link
Author

Yes, one issue lead to another. We are experiencing the reverse stacking of the captions. Looking for a quick solution we have an addition ttml files that is not bundled with the manifest the we wanted to load in addition to the embedded ttml files.

In the player.load i added the snippet:
`player.load(_globalSelf.manifest).then(function() {
parent.messageService.dispatch(ShoMediaNotifications.PLAYER_READY, null);
if(typeof parent.params.dash_ttml !== 'undefined){

this.player.addTextTrack(parent.params.dash_ttml, 'eng','caption', 'text/ttml');
}

}).catch(_globalSelf.onError);`

Assuming that is the correct addTextTrack syntax, I was thrown the following error:
'player errors out: tb[b] is not a constructor'

@TheModMaker
Copy link
Contributor

Have you tried with the latest master or the latest release? Does the error occur with the demo app? With the demo site, you can just load your manifest and run the following code in the JavaScript console:

shakaDemo.localPlayer_.addTextTrack('yourUrl', 'eng', 'caption', 'text/ttml');

Are all the captions the same type? If the external captions are TTML and the manifest ones are VTT or TTML in MP4, then we will error out in that version. We don't support switching between text track formats until v2.1.

Also, the code you posted may not work because you don't use bind. The nested function uses this, which will be window at that time. To work, you need to do something like this (though the error won't cause the errors you see):

player.load(...).then(function() {
  ...
}.bind(this));

As for the out of order lines, this is partially a browser problem. We just take the cues and create VTTCue objects and pass to the browser. When the browser displays cues that have overlapping times, it displays them on top of each other in reverse add order. That may be why they appear like that. I don't know if we support the offset attributes nor how the browser will render them.

@ismena
Copy link
Contributor

ismena commented May 24, 2017

@ewosleger I might be able to help with the ordering if you could tell me if the 'tts:writingMode' attribute is present on the segment and what it's value is if yes.

@ewosleger
Copy link
Author

We do not have the attribute "tts:writingMode" in our ttml.

@ewosleger
Copy link
Author

I believe out latest build version is Shake v 2.0.8 - I will update and test latest stable build.

@ismena ismena removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label May 24, 2017
@ismena
Copy link
Contributor

ismena commented May 24, 2017

I verified that we are parsing the "tts:origin" attribute and constructing the VttCues correctly, so it might be a bug on the browser's side as @TheModMaker mentioned.
Is this happening in a particular browser?

@joeyparrish joeyparrish added the type: bug Something isn't working correctly label May 25, 2017
@joeyparrish joeyparrish added this to the v2.2.0 milestone May 25, 2017
@joeyparrish
Copy link
Member

Let's split the caption ordering into a separate bug report. Here we will deal with the more severe issue of an API failing in compiled mode.

@ismena ismena added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jun 1, 2017
@joeyparrish joeyparrish removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jun 2, 2017
@joeyparrish
Copy link
Member

Even in uncompiled mode, the error is easily reproducible on the nightly and in v2.1.2:

https://nightly-dot-shaka-player-demo.appspot.com/demo/#asset=//ams-samplescdn.streaming.mediaservices.windows.net/11196e3d-2f40-4835-9a4d-fc52751b0323/TearsOfSteel_WAMEH264SmoothStreaming720p.ism/manifest(format=mpd-time-csf);play

Assertion failed: Inconsistent active stream
Uncaught exception in event handler TypeError: Cannot read property 'language' of undefined

It does not reproduce in v2.0.9.

@joeyparrish
Copy link
Member

We broke this in 6b6bfb7

@joeyparrish
Copy link
Member

Let's unpack several issues mentioned here.

Exception in addTextTrack

The exception you get ("tb[b]" etc), is caused by you passing the wrong MIME type. "text/ttml" is not the official MIME type of TTML, so our parser is not selected. Please use "application/ttml+xml" instead.

Display order for overlapping cues

We don't control this directly. Cues are displayed by the browser. I've split this into #848.

Exception in demo app

There is an exception in the demo app UI that prevents the UI from being updated correctly with the list of tracks. This is caused by an unexpected situation in which text tracks exist, but none are marked as "active" tracks when we hit shakaDemo.updateLanguageOptions_(). This is triggered by the Tears of Steel demo link above.

I thought this was the same error as the addTextTrack() exception in the original report, but it is not. There is also no difference here in compiled/uncompiled mode.

If we fix this exception in the demo, the UI is populated correctly and the text tracks can be manually selected, but none is selected for us by the player. So this doesn't really fix the root of the problem, which is that the Player fails to select the newly-added tracks.

This regression started in 6b6bfb7.

joeyparrish pushed a commit that referenced this issue Jun 15, 2017
There was a bug where manually added text tracks weren't added to the
active track list in Player.  This caused assertion failures and
problems with selecting those tracks.  Now those tracks will be tracked
correctly.  Note that Player will correctly select text tracks based on
language and will allow switching.

Closes #821

Change-Id: Ie9465a2d3bc757f43281ef40658daa488f58bc12
@shaka-project shaka-project locked and limited conversation to collaborators Mar 22, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

5 participants