Playing an Asset

View the generated preview URL for a content asset in Media Streams.

To access the session token service, you must have the following permissions on the compartment associated with the distribution channel containing the packaging configuration into which the asset was ingested:

  • read stream-distribution-channel
  • read stream-packaging-config
  • read stream-cdn-config

Users with permissions for the specific channel and configuration can generate a URL for asset playback.

Note

For better playback performance, use content with supported codecs. If the audio isn't supported, the video might play without the audio. The supported video codec is H.264, and the supported audio codecs are AAC and MP3.
  • During content playback, a session token is used to authenticate the asset streamer. The Console obtains a session token to view the content for 24 hours.

    1. On the Distribution channels list page, select the compartment that contains the distribution channel with the asset that you want to play. If you need help finding the list page, see Creating a Preview URL.
    2. Select the name of the channel that contains the asset that you want to play.
    3. On the details page, select Playlist assets.
    4. Select the playlist asset that you want to play.
    5. On the playlist asset details page, select the Actions menu and then select Preview URL.
    6. In the Preview URL panel, select a packaging configuration to use for the content delivery.
    7. Specify a session token expiration value between 10 minutes and 24 hours. The preview URL expires after the specified time period.
    8. Select Generate.
      A preview URL is generated for the asset. If the URL generation is successful, the preview URL is displayed.
    9. Copy the URL, and paste it in a supported browser.
      You can view the asset directly in the browser.
      Note

      A token is created for every preview URL request. The token expires after 24 hours. After the token expires, you must generate a new preview URL for asset playback.
  • Playlist generation requires a session token for authentication. Therefore, you must generate a session token before generating a playlist. The session token is valid for 24 hours.

    To generate a token, use the generate-session-token command:

    oci media-services media-stream stream-distribution-channel generate-session-token [OPTIONS]

    Required parameters for the generate-session-token command:

    • --endpoint [text]
    • --packaging-config-id [text]
    • --scopes [text]
    • --asset-ids [text]

    After the session token is generated, generate the playlist to play the asset by using the generate-playlist command:

    oci media-services media-stream stream-distribution-channel generate-playlist [OPTIONS]

    Required parameters for the generate-playlist command:

    • --file [filename]
    • --media-asset-id [text]
    • --stream-packaging-config-id [text]
    • --endpoint [text]
    • --token [text]
    Note

    The --endpoint parameter must point to the domain of the desired distribution channel.

    To get all the commands for stream-distribution-channel:

    oci media-services stream-distribution-channel -h

    To get help for the generate-session-token command:

    oci media-services media-stream stream-distribution-channel generate-session-token -h

    To get help for the generate-playlist command:

    oci media-services media-stream stream-distribution-channel generate-playlist -h

    For a complete list of flags and variable options for CLI commands, see the Command Line Reference.

  • To play an asset, use the GeneratePlaylist and GenerateSessionToken operations.