Creating a Preview URL

Create a preview URL in Media Streams and view your content asset in a browser.

Note

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.

    1. Open the navigation menu  and select Analytics & AI. Under Media Services, select Media Streams.
    2. On the Distribution channels list page, select the compartment that contains the distribution channel for where you want to generate the preview URL.
    3. Select the name of the distribution channel from which you want to generate the preview URL.
    4. On the details page, select Playlist assets.
    5. Select the playlist asset for which you want to generate the preview URL.
    6. On the playlist asset details page, select the Actions menu and then select Preview URL.
    7. In the Preview URL panel, select a packaging configuration to use for the content delivery.
    8. Specify a session token expiration value between 10 minutes and 24 hours. The preview URL expires after the specified time period.
    9. Select Generate.
      A preview URL is generated for the asset.
    10. Copy the URL.
      You can view the asset by playing it in a supported browser or application.
  • 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 the steps in 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>
                                
    Where:
    • <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 the GenerateSessionToken operation returns.

    View the asset by copying the preview URL and playing it in a supported browser or application.