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 click Analytics & AI. Under Media Services, click 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. Click the name of the distribution channel from which you want to generate the Preview URL.
    4. On the Distribution Channel details page, under Resources, click Playlist Assets.
    5. In the Playlist Assets section, click the playlist asset for which you want to generate the preview URL.
    6. On the Playlist Asset details page, in the Preview URL section, select a packaging.
    7. Specify the session token expiration value between 10 minutes to 24 hours. The preview URL expires after the specified time period.
    8. Click Generate.
      A preview URL is generated for the asset.
    9. Click Copy.
      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 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 the GenerateSessionToken operation returns.

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