• How to create and view player URLs by using the Wowza Streaming Cloud REST API

    When you add a live stream, the Wowza Streaming Cloud™ service creates two playback URLs: one for viewing the stream in a browser on a computer and one for viewing the stream on a mobile device. By using the REST API, you can view and edit those URLs as well as create additional URLs for playing streams at other bitrates. For example, you can create player URLs for other output renditions that a transcoder is using.

    Contents


    Create a live stream
    Create a player URL
    Related requests

    Create a live stream


    1. Using the Wowza Streaming Cloud REST API, create a live stream or a transcoder that receives video from a source encoder and delivers the stream to a hosted page or the transcoded output to a target. For instructions, see How to broadcast a live stream by using the Wowza Streaming Cloud REST API.

    2. Make note of the unique player_id that Wowza Streaming Cloud creates for your live stream.

    Create a player URL



    Player URL parameters

    Parameter Data Type Description
    bitrate integer The video bitrate, in kilobits per second (Kbps), of the output rendition that will be played at the URL. May correspond to the bitrate of an output rendition being used by the live stream or transcoder. Must be greater than 0.
    height integer The height, in pixels, of the output rendition that will be played at the URL. May correspond to the height of an output rendition being used by the live stream or transcoder. Must be greater than 0.
    label string A descriptive name for the player URL. Maximum 255 characters.
    url string The URL of the player. If using Wowza CDN targets, the URL format is http://wowzadev-f.akamaihd.net/z/[stream_name]_[angle]@[stream_id]/manifest.f4m for Adobe HDS playback or http://wowzadev-f.akamaihd.net/i/[stream_name]_[angle]@[stream_id]/master.m3u8 for Apple HLS playback.
    width integer The width, in pixels, of the output rendition that will be played at the URL. May correspond to the width of an output rendition being used by the live stream or transcoder. Must be greater than 0.

    Example request

    Note: In all code examples, for [key], substitute your API key or your access key as appropriate. For more information, see Locating and using API and access keys.
    curl -X POST --header "Content-Type: application/json" --header "wsc-api-key: [key]" --header "wsc-access-key: [key]" -d '{
       "url": {
         "bitrate": "640",
         "height": "288",
         "label": "My384_playerurl",
         "url": "http://[wowzasubdomain].akamaihd.net/z/[stream_name]_[angle]@[stream_id]/master.m3u8",
         "width": "384"
       }
    }' "http://api.cloud.wowza.com/api/v1/players/1234abcd/urls"
    The request generates a player URL for the player whose ID is 1234abcd. The URL will play an output rendition with a bitrate of 640 Kbps and a frame size of 384 x 288 pixels. The request creates a URL whose details are listed in the response, which should look something like this:

    {
       "url": {
         "bitrate": "640",
         "created_at": "2016-03-25T11:53:28.508",
         "height": "288",
         "id": "1234abcd",
         "name": "My384_playerurl",
         "updated_at": "2016-03-25T11:53:28.508",
         "url": "http://[wowzasubdomain].akamaihd.net/z/[stream_name]_[angle]@[stream_id]/master.m3u8",
         "width": "384"
       }
    }
    After adding or editing a player URL, you must rebuild the player in order for the changes to take effect. Use the command:

    curl -H 'wsc-api-key: [key]' -H 'wsc-access-key: [key]' -H 'Content-Type: application/json' -X DELETE http:// http://api.cloud.wowza.com/api/v1/players/[player_id]/rebuild

    Related requests


    View a transcoder's outputs:

    curl -H 'wsc-api-key: [key]' -H 'wsc-access-key: [key]' -H 'Content-Type: application/json' -X GET http://api.cloud.wowza.com/api/v1/transcoders/[transcoder_id]/outputs
    View the details of an output rendition:

    curl -H 'wsc-api-key: [key]' -H 'wsc-access-key: [key]' -H 'Content-Type: application/json' -X GET http://api.cloud.wowza.com/api/v1/transcoders/[transcoder_id]/outputs/[output_id]
    View a player's URLs:

    curl -H 'wsc-api-key: [key]' -H 'wsc-access-key: [key]' -H 'Content-Type: application/json' -X GET http://api.cloud.wowza.com/api/v1/players/[player_id]/urls
    View the details of a player URL:

    curl -H 'wsc-api-key: [key]' -H 'wsc-access-key: [key]' -H 'Content-Type: application/json' -X GET http://api.cloud.wowza.com/api/v1/players/[player_id]/urls/[player_URL_id]
    Update a player URL:

    curl -H 'wsc-api-key: [key]' -H 'wsc-access-key: [key]' -H 'Content-Type: application/json' -X PATCH -d '{"url":{"label":"480 Modified"}}' http:// http://api.cloud.wowza.com/api/v1/players/[player_id]/urls/[player_URL_id]
    Delete a player URL:

    curl -H 'wsc-api-key: [key]' -H 'wsc-access-key: [key]' -H 'Content-Type: application/json' -X DELETE http:// http://api.cloud.wowza.com/api/v1/players/[player_id]/urls/[player_URL_id]

    Originally Published: 03-15-2016.
    Updated: 11-28-2016.

    If you're having problems or want to discuss this article, post in our forum.