Configuring Audio-Only Streaming on Mobile SDK for iOS and Android

Was this article helpful?

Note: Audio-Only stream auto-detection is not yet supported - you must specify in advance what type of Player you would use to play a stream with (Audio-Only type or Video type).

Configuring Audio-Only streaming on Mobile SDK for Android

To set up an Ooyala Player for Audio-Only streaming, ensure that the Player is configured to only use audio-only content - no video (including slates) should be present in streams for audio-only use.

For a demonstration of this feature, please see our sample application on the following link, and refer to the configuration notes below:

https://github.com/ooyala/android-sample-apps/pull/383

In this Ooyala Android sample application bundle, you must also add the new setAudioOnly(true) option to the createPlayerOptions() method in the AudioOnlyPlayerActivity.java file (located under /OoyalaSkinSampleApp/app/src/main/java/com/ooyala/sample/players/), as shown in the example below:

private Options createPlayerOptions() {
  return new Options.Builder()
    .setShowNativeLearnMoreButton(false)
    .setShowPromoImage(false)
    .setUseExoPlayer(true)
    .setAudioOnly(true) // This is crucial
    .build();
}

Configuring Audio-Only streaming on Mobile SDK for iOS

To set up an Ooyala Player for Audio-Only streaming, ensure that the Player is configured to only use audio-only content - no video (including slates) should be present in streams for audio-only use.

For a demonstration of this feature, please see our sample applications on the following links, and refer to the configuration notes below:

  • BasicPlaybackSampleApp - available here: BasicPlaybackSampleApp.

    Note: Developers must either reuse the existing class OODefaultAudioOnlyPlayerInfo or implement a custom class conforming to the PlayerInfo protocol.
  • OoyalaSkinSampleApp - available here: OoyalaSkinSampleApp.

    Note: In this sample app, a separate controller is used - AudioOnlySkinPlayerViewController. However, the implementation logic is the same as for the basic sample app above.

For both sample apps, setDefaultPlayerInfo must be configured before the embed code is assigned - for example:

[OOStreamPlayer setDefaultPlayerInfo:[OODefaultAudioOnlyPlayerInfo new]];
https://help-ooyala.brightcove.com/sites/all/libraries/dita/en/video-platform/concepts/audio_only_player/audio_only_player_mobile_sdk.html