Re: [media] change proposals for issue-152

On Wed, Mar 30, 2011 at 4:03 PM, Mark Watson <watsonm@netflix.com> wrote:
> Sylvia wrote (sorry if formatting messes up - copied from archives)...
>
> So, I think it would probably be better if instead we recommend that
> if you wanted to use in-band tracks, you should use media fragment
> addressing, such as:
>
>     <!-- in-band german sign language track -->
>     <video id="v3" timeline="v1" kind="signing" srclang="gsg"
> label="German Sign Language">
>       <source src=“video.webm#track=video_gsg” type=”video/webm”>
>       <source src=“video.mp4#track=video_gsg” type=”video/mp4”>
>     </video>
>
> What do people think?
>
> This is fine for addressing and controlling in-band tracks, but how do I
> *discover* them in the first place. I need to get a list of the tracks and
> their kinds and names so that I can decide what choices to offer the user
> (assuming I am providing my own controls).
> ...Mark

If the author expressly places all in-band tracks into <audio> and
<video> elements, then they would be exposed in this way.

However, for in-band audio and video elements that are not exposed in
this way, that is certainly an issue. Such tracks would just be
exposed and displayed by the browser they cannot be controlled from
JavaScript unless listed in a slave <audio> or <video> element. So,
since it is in the control of the author to expose them, it is
probably sufficient.

For example: to get all the audio tracks that have been exposed in
slave audio elements for a video with id="v1", you would do:

audioTracks = new Array[];
index = 0;
for (i in document.getElementsByTagname("audio")) {
  if (i.timeline == "v1") {
    audioTracks[index] = i;
    index++;
  }
}

Not elegant, but it works...

Cheers,
Silvia.

Received on Thursday, 31 March 2011 00:04:03 UTC