mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-14 15:56:38 +03:00
8391fe1684
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
49 lines
1.2 KiB
JavaScript
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;
|