目录

Audio/Video Casting

For audio and video applications, the media controller provides a system-level entry to select a device for switching and casting, along with a unified projection component (named AVCastPicker) for audio and video output devices. By integrating this component, your application can cast audio and video resources to a remote device using either the Cast+ or DLNA protocol, both within the application itself and through the media controller. To ensure smooth integration with the component, the application must integrate the basic playback control capabilities based on the self-check requirements.

Basic Casting Capabilities

[h2]Cast+/DLNA Audio and Video Casting

Self-verification focus: Play audio and video resources that can be projected, and cast them to TV of a version later than 3.1 or DLNA-compatible devices. Check whether the casting process is normal and whether the remote playback can be controlled from the application and the media controller.

  1. Check whether the picker is correctly displayed.

    If not, review the integration of the basic playback control capabilities based on the self-check requirements.

  2. Once both devices are online, check whether the list of castable devices is displayed in the application and media controller.

    If no, check whether setExtras({requireAbilityList: ['url-cast']}) is set. For details, see AVCastPicker Development.

  3. Check whether the target device plays the content correctly.

    If the peer device displays a black screen or does not display the playback content, the application checks whether the resource link is correctly set and correctly calls the prepare and start APIs. For details, see AVCastPicker Development.

  4. After casting, check whether the remote playback actions like play/pause, previous/next, progress control, and volume adjustment can be controlled in the media controller.

    The application registers necessary control instructions based on the actual features and the self-check table. For example, on(type: 'playbackStateChange') is used to listen to the playback pause instructions of the medial controller and remote devices. For details about the development of control instructions, see AVCastPicker Development.

[h2]DRM Video Casting

Self-check focus: Play a DRM-protected video that can be cast to TV of a version later than 3.1 or a large-screen device that supports DRM hardware decoding, and check whether the casting process is normal.

Enhanced Casting Capabilities

[h2]Automatic Switching to Resource Casting

Self-check focus: After initiating wireless projection in Control Panel, play audio and video resources that can be cast in the application and check whether the application automatically transitions to resource casting mode (either via the Cast+ protocol or DLNA protocol).

Turn on wireless projection to cast mobile phones to large screens. After you open a video application on the mobile phones, the application should seamlessly switch to resource casting. For details, see Automatic Switching to Resource Casting.