Playing an Asset
View the generated preview URL for a content asset in Media Streams.
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.
For better playback performance, use content with supported codecs. If the audio is not supported, the video might play without the audio. The supported video codec is H.264, and the supported audio codecs are AAC and MP3.
- 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
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
andGenerateSessionToken
operations.