All Products
Search
Document Center

ApsaraVideo VOD:Other FAQ

Last Updated:May 22, 2023

This topic describes common errors in ApsaraVideo VOD and provides the corresponding solutions.

What do I do if the "No 'Access-Control-Allow-Origin'" error message appears?

The No 'Access-Control-Allow-Origin' error message appears because cross-origin resource sharing (CORS) is not configured. Perform the following steps to configure CORS:

  1. Log on to the ApsaraVideo VOD console.

  2. In the left-side navigation pane, choose Configuration Management > CDN Configuration > Domain Names.

  3. Find the domain name that you want to configure and click Configure in the Actions column.

  4. On the page that appears, click Cache.

  5. On the Custom HTTP Response Headers tab, click Add to configure a custom HTTP response header.

    In the dialog box that appears, set Response Header to Access-Control-Allow-Origin and Response Header Value to * or the domain name that you want to access, such as www.aliyundoc.com. For more information, see Configure a custom HTTP response header.

  6. Click OK.

For more information about how to configure CORS for ApsaraVideo Player SDK for Web, see Configure CORS.

What do I do if an error indicating that AliyunVODDefaultRole does not exist occurs?

If you want to use features such as HTTP Live Streaming (HLS) encryption, Message Service (MNS) callbacks, and temporary access authorization provided by Security Token Service (STS) in ApsaraVideo VOD, you must grant ApsaraVideo VOD permissions to access corresponding services. For example, you must grant ApsaraVideo VOD permissions to access Key Management Service (KMS) and MNS to use HLS encryption and MNS callbacks.

AliyunVODDefaultRole is a role created by ApsaraVideo VOD. AliyunVODDefaultRole has specific permissions to manage resources in Object Storage Service (OSS), MNS, Alibaba Cloud CDN, and KMS. If an error indicating that AliyunVODDefaultRole does not exist occurs, grant permissions to ApsaraVideo VOD on the Cloud Resource Access Authorization page. For example, if the The role not exists: acs:ram::1748098****:role/AliyunVODDefaultRole. error message appears, AliyunVODDefaultRole does not exist.

What do I do if the "ERROR_SERVER_VOD_FORBIDDEN_ALIYUNVODENCRYPTION" error code is returned when I play videos encrypted by using Alibaba Cloud proprietary cryptography?

By default, if you call the GetPlayInfo operation to obtain playback URLs and play videos, streams encrypted by using Alibaba Cloud proprietary cryptography are not returned. In this case, videos encrypted by using Alibaba Cloud proprietary cryptography cannot be played and the ERROR_SERVER_VOD_FORBIDDEN_ALIYUNVODENCRYPTION error code is returned. You can use one of the following methods to solve this problem:

  • Method 1: Set ResultType to Multiple when you call the GetPlayInfo operation to obtain playback URLs of all transcoded streams.

  • Method 2: Use ApsaraVideo Player SDK to decrypt and play videos that are encrypted by using Alibaba Cloud proprietary cryptography. We recommend that you use ApsaraVideo Player SDK to play videos. For more information, see Use ApsaraVideo Player SDK.

What do I do if playback URLs expire?

Problem description

When you use a browser to access a playback URL in ApsaraVideo VOD, the following error message appears:

<Error>
  <Code>AccessDenied</Code>
  <Message>Request has expired.</Message>
  <RequestId>5DF332644EAA4931361D1E43</RequestId>
  <HostId>
    outin-2cc63XXXXXXe1c955c.oss-cn-shanghai.aliyuncs.com
  </HostId>
  <Expires>2019-12-13T06:37:22.000Z</Expires>
  <ServerTime>2019-12-13T06:40:36.000Z</ServerTime>
</Error>

Causes

Media assets in ApsaraVideo VOD are stored based on OSS. If you do not add an accelerated domain name in ApsaraVideo VOD, OSS storage addresses are used for the source files and transcoded streams in ApsaraVideo VOD, such as outin-6a6fd4XXXXXXe1a65b6.oss-cn-shanghai.aliyuncs.com. Transcoded streams include LD, SD, and HD video streams.

By default, OSS buckets that are used to store media assets in ApsaraVideo VOD are private. To access the buckets, you must include the Expires, Signature, and AccessKey ID parameters in the URL. The signed URL expires after the validity period specified for Expires elapses. The value of Expires is a UNIX timestamp. The preceding error may be caused by the following reasons:

  • You did not add an accelerated domain name in ApsaraVideo VOD.

  • You did not set the access control list (ACL) of the OSS bucket to Public Read and Private Write. By default, the ACL of the OSS bucket is private.

Solutions

Use one of the following solutions to solve this problem:

If you do not use an accelerated domain name to access OSS buckets, video playback is not accelerated and you are charged for the outbound traffic. In this case, you cannot use ApsaraVideo VOD data transfer plans to offset the outbound traffic fees. You can use data transfer plans to offset only traffic fees that are incurred when you use accelerated domain names to play videos. We recommend that you use Solution 1. This way, Alibaba Cloud CDN is used to accelerate video playback and traffic fees can be offset by data transfer plans.

(Recommended) Solution 1: Add an accelerated domain name in ApsaraVideo VOD

Usage notes

  • Before you configure a CNAME record for the accelerated domain name, you must delete the A record. For more information about the conflict between a CNAME record and an A record, see DNS record conflict rules.

  • We recommend that you do not use website domains because most of the website domains are resolved by using A records. In this case, if you delete the A record, the website becomes inaccessible.

  • By default, URL signing is not enabled for accelerated domain names in ApsaraVideo VOD and playback URLs do not expire. If you enable URL signing for accelerated domain names, playback URLs expire after a specified period of time. For more information about URL signing, see Configure URL signing.

Procedure

  1. Log on to the ApsaraVideo VOD console.

  2. In the left-side navigation pane, choose Configuration Management > CDN Configuration > Domain Names. The Domain Names page appears.

  3. Check whether an accelerated domain name is configured.

    • If an accelerated domain name is added but is not enabled, enable the accelerated domain name and make sure that a CNAME record is configured.

    • If no accelerated domain name exists, perform the following step to add an accelerated domain name.

  4. On the Domain Names page, click Add Domain Name, specify the parameters, and then click Submit.

    For more information about the parameters, see Add a domain name for CDN. After you add an accelerated domain name, configure a CNAME record for the domain name. For more information, see Add a CNAME record in Alibaba Cloud DNS. We recommend that you configure cache settings to boost your website performance. For more information, see Cache settings.

Solution 2: Set the ACL of the default OSS bucket to Public Read and Private Write

Change the ACL of the OSS bucket to Public Read and Private Write. This way, no signature information is required to access the bucket and the playback URLs of videos do not expire.

Warning

After you set the ACL of the OSS bucket to Public Read and Private Write, media files stored in the bucket can be publicly accessed. This may result in data leakage and unexpectedly high costs. Exercise caution when you set the ACL of the OSS bucket to Public Read and Private Write.

  1. Log on to the ApsaraVideo VOD console.

  2. In the left-side navigation pane, choose Configuration Management > Media Management > Storage. The Storage page appears.

  3. Find the bucket that you want to manage and click Manage in the Actions column.

  4. In the Permissions section, click Modify.

  5. Set Read-write permission to Public Read and Private Write and click OK.

  6. Remove signature parameters from playback URLs. After you set the ACL of the bucket to Public Read and Private Write, signature parameters are not automatically removed from the playback URLs in the ApsaraVideo VOD console. You must manually remove the content after ? (included) from playback URLs. The following URL provides an example of a URL that does not expire.

    https://outin-ebdeeXXXXXX3e008181.oss-cn-shanghai.aliyuncs.com/1db42d58e9694bf681d838f0ed9****/d0a5a57cb830412ca133607e****-ld.mp4