Files
shaka-player/externs/texttrack.js
T
Joey Parrish 8391fe1684 Extend Player track methods to cover native HLS
Track methods are now implemented for native HLS and other src=
playbacks.  This will allow the UI to select text and audio languages.

This change adds best-effort methods to get track information for src=
playbacks, including native HLS on Safari.  In many cases, it relies
on the audioTracks and videoTracks members of HTMLVideoElement which
are only implemented on Safari.  They are in the spec, though, so
there's no harm in using them when they exist.

This is fully parallel to the manifest-based paradigm for MSE-based
playbacks.  Each of these top-level methods in Player has an "if" to
decide which way to supply the requested info, except for the language
methods, which now delegate to the track methods.

With this, Safari's native HLS can supply audio and text language
information to the UI/app, and the UI/app can have some control over
those things through the tracks API.  I believe this is important to
the success of our new iOS support.

Issue #997
Issue #382

Change-Id: Icc44a932927fafedda1b62a9d4c6e2ed3dc7db30
2019-04-30 21:15:00 +00:00

49 lines
1.2 KiB
JavaScript

/**
* @license
* Copyright 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Externs for TextTrack and TextTrackCue which are
* missing from the Closure compiler.
*
* @externs
*/
/** @type {string} */
TextTrack.prototype.id;
/** @type {string} */
TextTrack.prototype.kind;
/** @type {string} */
TextTrack.prototype.label;
/** @type {string} */
TextTrackCue.prototype.positionAlign;
/** @type {string} */
TextTrackCue.prototype.lineAlign;
/** @type {number|null|string} */
TextTrackCue.prototype.line;
/** @type {string} */
TextTrackCue.prototype.vertical;
/** @type {boolean} */
TextTrackCue.prototype.snapToLines;