Creating a Preview URL
Create a preview URL in Media Streams and view your content asset in a browser.
The Safari browser can play the HLS natively. Other browsers require an extra plugin or supported application to preview the HLS format.
You can generate a Preview URL of the playlist asset from the Playlist Asset details page.
Creating a Preview URL directly using the CLI isn't possible. You must generate a session token using the CLI and generate the Preview URL manually, by using the token ID. The session token is required for authentication and 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]
Note
The--endpoint
parameter must point to the domain of the desired distribution channel.After the session token is created, follow these steps to Creating a Preview URL Manually.
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
For a complete list of flags and variable options for CLI commands, see the Command Line Reference.
- If you're unable to access the Console, you can manually create a Preview URL by using the following:
https://<DC_DOMAIN>/20211101/actions/generatePlaylist?mediaAssetId=<ASSET_ID >&streamPackagingConfigId=<PKG_ID>&token=<TOKEN_DATA>
Here,<DC_DOMAIN>
is the domain from the GetStreamDistributionChannel operation.<PKG_ID>
is the OCID of the packaging configuration used for streaming.<ASSET_ID>
is the OCID of the asset to be streamed.<TOKEN_DATA>
is the token that theGenerateSessionToken
operation returns.
View the asset by copying the preview URL and play it in a supported browser or application.