API Updates FAQ Start Using Swift

Swift API Updates

The Ooyala Player API is largely unchanged with the release of our new player (Swift) and we have made every effort to maintain complete backwards compatibility. Most implementations will not require any changes. For completeness and reference, we list any updates introduced below.

New Events

There is a new event called "apiReady". Going forward, this new event should be used in favor of the "loadComplete" event. The difference between apiReady and loadComplete is that apiReady will be dispatched every time the embed code changes (including the first time the player starts), whereas loadComplete is only dispatched once, the first time the player is loaded.

Updates to event sequence

The order of events has been updated under certain scenarios in the new player. Outlined below are examples with the differences highlighted.

When loading a video

Key differences:

  • In the new player, the apiReady and loadComplete events are dispatched after the video has finished loading and is ready to play.
  • The new player dispatches an embedCodeChanged event when the player initially loads its first embed code, whereas the old player does not.
  • The new player does not dispatch an initial playheadTimeChanged event with a value of 0, as the old player does.

Show example

When playing a video

Key differences:

  • The new player skips the "paused" state between "buffering" and "playing" when playing a video.

Show example

When loading a channel

Key differences:

  • The new player dispatches a currentItemEmbedCodeChanged when it begins playing the first item in the channel, whereas the old player does not.

Show example

When seeking in a video that is currently playing

Key differences:

  • The new player does not enter the paused state when it begins seeking.

Show example

When completing one video in a channel and playing the next video in the channel

Key differences:

  • The old player dispatches a totalTimeChanged event twice when the item in the channel changes: once with a value of "0", and then once again for the video's total time. The new player instead dispatches a single totalTimeChanged event with the length of the video.

Show example