Files
shaka-player/lib/routing/payload.js
T
Aaron Vaage b978ae83b5 Refactor Player to Use Walker
This is the initial integration between the walker and the player. In
order to make this simpler, this keeps all of "load" as one transition
and will slowly break it into multiple parts in later CLs.

Tests that focused on verifying the changes in states were moved from
the unit tests to the integration tests.

As of this CL we model the load graph as:

  Detached -> Attached -> Loaded -> Unloading
      ^         ^                       |
      |         |                       |
      +---------+-----------------------+

With this CL we lose:
  - Interrupting manifest load retries when interrupting a load.
  - Interrupting loading.
  - Pre-initializing media source.

We have immediate plans to add back:
  - Interrupting loading.
  - Pre-initializing media source.

We are still designing how to handle:
  - Interrupting manifest load retries when interrupting a load.

Issue #816
Issue #997
Issue #1570

Change-Id: Ie929621f94c2701f7d4e031b7a31dbd1c74a69c6
2019-02-26 23:42:36 +00:00

61 lines
2.1 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.
*/
goog.provide('shaka.routing.Payload');
/**
* @typedef {{
* factory: ?function():!shaka.extern.ManifestParser,
* mediaElement: HTMLMediaElement,
* mimeType: ?string,
* startTime: ?number,
* startTimeOfLoad: ?number,
* uri: ?string
* }}
*
* @description
* The payload is the information to "deliver" to our destination. When
* moving from node-to-node, the payload may be modified.
*
* @property {?function():!shaka.extern.ManifestParser} factory
* The manifest parser factory that should be used to parse the manifest
* at |uri|. This should be |null| when |mimeType| is not |null|.
*
* @property {HTMLMediaElement} mediaElement
* The media element that we are or will be using.
*
* @property {?string} mimeType
* The mime type of the content that we will parse. This will be used when
* picking which parser to use. This should be |null| when |factory| is not
* |null|.
*
* @property {?number} startTime
* The time (in seconds) where playback should start. When |null| we will
* use the content's default start time (0 for VOD and live edge for LIVE).
*
* @property {?number} startTimeOfLoad
* The time (in seconds) of when a load request is created. This is used to
* track the latency between when the call to |Player.load| and the start
* of playback. When the payload is not for a load request, this should be
* |null|.
*
* @property {?string} uri
* The address of the content that will be loaded.
*/
shaka.routing.Payload;