Ooyala provides bitrate and buffering functions and events. In addition, Ooyala uses a number of heuristics to make playback as smooth as possible.
Bitrate controls on the player UI and bitrate APIs are supported for all content types (Ooyala VOD, remote VOD, remote live, remote live DV).
|get Methods||set Methods|
Determining Available Bitrates
The example below will show determining what bitrates are available and then will show what happens when you attempt to set some incorrect and correct values. This example assumes the player ID is pp. You will often see undefined in the console logs, which is normal for the bitrate API.
pp.getBitratesAvailable() [Object > bitrate: 470000 height: 180 id: "0" width: 320_proto_: Object, Object > bitrate: 788000 height: 360 id: "1" width: 640_proto_: Object, Object > bitrate: 1157000 height: 360 id: "2" width: 640_proto_: Object, Object > bitrate: 1760000height: 720id: "3"width: 1280_proto_: Object, Object > bitrate: 2512000height: 720id: "4"width: 1280_proto_: Object, Object > bitrate: 3986000height: 1080id: "5"width: 1920_proto_: Object, Object > bitrate: 4657000height: 1080id: "6"width: 1920_proto_: Object, Object > bitrate: 0height: 0id: "auto"width: 0_proto_: Object]
To set the target bitrate, use one of the id values returned from getBitratesAvailable().
Manually Setting a Bitrate
You can manually set a bitrate after the PLAYING event occurs with setTargetBitrate().
- Listen to the BITRATE_INFO_AVAILABLE event.
- Get the desired bitrate "id" (string).
- Listen to the PLAYING event.
- Once the PLAYING event is triggered, call setTargetBitrate("id").
For more information on how to use setTargetBitrate, see http://apidocs.ooyala.com/player_v4_js/OO.Player.html.
In addition to the bitrate and buffer functions and events, Ooyala uses a number of heuristics to make playback as smooth as possible on every device, such as bandwidth estimation, content size, screen size and so forth. ABR playback (HLS, specifically) is preferred whenever available on the underlying devices.ABR is a technology that allows the Ooyala Player to adjust/change the bitrate of the stream delivered based on the bandwidth available to the viewer as measured over a period of time. The purpose of ABR is to compensate for drops or increases in bandwidth by lowering or upgrading the stream quality. The ABR changes to the stream quality do not happen immediately. This is not an instantaneous process. To make a bitrate change to the video stream, the player:
- Detects the change in bandwidth.
- Waits to confirm it is permanent vs. a momentary fluctuation.
- Sends a request to the Akamai Flash Media Server to shift to stream at the new bitrate.
- Waits for Akamai to deliver the new bitrate stream.
- Starts delivering the new bitrate to the viewer.