Set up on demand video

You need to run the "Create or update a policy" operation via the ACE API, and set the type element value to streaming-video-on-demand in the content-characteristics behavior in a subcustomer's delivery policy.

Create or update a policy

General instructions on this operation can be found in the Akamai Cloud Embed API v2 documentation. (See Create or update a policy.)

Define the appropriate match criteria in the delivery policy

Like all other rules in a delivery policy, you must set a match criteria (matches) that must be met to apply the associated behaviors. In the example presented here, the url-wildcard match is used. This match compares the incoming request path (excluding query string) to what is defined as the value for the match "/*" is set here, which indicates all incoming request paths.

Include the "content-characteristics" behavior in the delivery policy

To set up this support, you need to include the content-characteristics behavior, and the following members must be included:

  • type: This must be set to streaming-video-on-demand.
  • value: This must be included and always be set to a hyphen (-).

With just these members set, on demand video is enabled for the subcustomer, using default settings.

You can set optional parameters

You have access to additional parameters ("params") with the content-characteristics behavior, when configuring support for on demand streaming video. Each allows you to define the segment duration for various supported media formats:

Note: To configure these parameters in a subcustomer's delivery policy, that subcustomer must be registered with a base configuration that has had the parameters enabled. They are enabled via the Content Characteristics - Streaming Video On-demand behavior. (This behavior must be added to the base configuration, and the parameters must be set to "On.") If the behavior is not added, or a parameter is set to "Off," they cannot be included.
Name Type Description *
segmentDurationHLS Float (optional) This is the duration, in seconds for HLS media segments. The supported range is 0.1 to 10.0. The Akamai default value is 10.0 seconds. See Apple Technical Note 2224 for their recommended best practices.
segmentDurationHDS Float (optional) This is the duration in seconds for HDS media segments. The supported range is 0.1 to 10.0. The Akamai default value is 6.0 seconds.
segmentDurationDASH Float (optional) This is the duration in seconds for DASH media segments. The supported range is 0.1 to 10.0. The Akamai default value is 6.0 seconds.
segmentDurationSmooth Float (optional) This is the duration in seconds for Smooth media segments. The supported range is 0.1 to 10.0. The Akamai default value is 2.0 seconds.
prefetch Object Use this object to enable and configure origin-assisted segment prefetching for on demand video for this subcustomer. This is disabled (set to "false") by default.
Complete details and requirements are covered in How to add prefetching support for video.
Note: HDS format video is currently not supported for use with prefetching.

* The default durations here only apply if you did not apply a custom value via the Content Characteristics - Streaming Video On Demand behavior in the associated base configuration.

The Akamai platform identifies the media format by examining the URI file extension or the structure of the URI path, and automatically optimizes various settings relating to cache efficiency, cache time-to-live, automated failover/retry, downstream “Content-Type” headers, and network timeout conditions for on-demand video content.

JSON Examples

  • Example 1: This example shows how an endpoint is optimized for on demand video streaming.
    {
        "rules":[
            {  
                "matches": [
                    {
                        "name": "url-wildcard",
                        "value": "/*"
                    }
                ],
                "behaviors": [
                    {
                        "name": "origin",
                        "value": "-",
                        "params": {
                            "cacheKeyValue": "-",
                            "digitalProperty": "videocustomer.partnerdomain.net",
                            "cacheKeyType": "origin",
                            "hostHeaderValue": "-",
                            "originDomain": "videocustomer.origin.mediaservices.partnerdomain.net",
                            "hostHeaderType": "origin"
                        },
                    },
                    {
                        "name": "content-characteristics",
                        "type": "streaming-video-on-demand",
                        "value": "-",
                        "params": {
                            "segmentDurationHLS": 10,
                            "segmentDurationHDS": 5.5,
                            "segmentDurationDASH": 3,
                            "segmentDurationSmooth": 4.5,
                            "prefetch": {
                                "originAssist": true
                            }
                        }
                    }
                ]
            }
        ]
    }
  • Example 2: You can also omit some or all of the segment duration params, as well as the additional parameters. If you do, the applicable default duration setting is applied for each media format:
    • I included the Content Characteristics - Streaming Video On Demand behavior in my base configuration. If you've set a different value for segment duration for a specific media format, that value is used.
    • I didn't include the Content Characteristics - Streaming Video On Demand behavior in my base configuration. The default durations discussed in the table above are applied for each media format.

    The snippet below shows the content-characteristics behavior with an empty params object to use default durations.

    {
        "name": "content-characteristics",
        "type": "streaming-video-on-demand", 
        "value": "-",
        "params":{}
    }