10789594创建于 2024年3月18日历史提交
文件最后提交记录最后更新时间
add DistributedAppDev folder Signed-off-by: guojin31 <guojin31@huawei.com> 3 年前
ArkTs 整改 2 年前
ArkTs 整改 2 年前
ArkTs 整改 2 年前
add DistributedAppDev folder Signed-off-by: guojin31 <guojin31@huawei.com> 3 年前
ArkTs 整改 2 年前
description: Add build-profile.json5 ! Sig: SIG_Sample Feature or Bugfix: Bugfix Binary Source: No Signed-off-by: taobohao <taobohao@huawei.com> 3 年前
add DistributedAppDev folder Signed-off-by: guojin31 <guojin31@huawei.com> 3 年前
修复SuperFeature下readme断链 Signed-off-by: zwx1126739 <zhanghong121@huawei.com> 2 年前
ArkTs 整改 2 年前
add DistributedAppDev folder Signed-off-by: guojin31 <guojin31@huawei.com> 3 年前
Audio、Screen、StorageStatistic、CustomNotification、AppAccountManager、ArkTSDistributedMusicPlayer ohpm迁移 Signed-off-by: zwx1126739 <zhanghong121@huawei.com> 3 年前
Audio、Screen、StorageStatistic、CustomNotification、AppAccountManager、ArkTSDistributedMusicPlayer ohpm迁移 Signed-off-by: zwx1126739 <zhanghong121@huawei.com> 3 年前
4.0release OAT修改 Signed-off-by: nobbo <gaoshang22@huawei.com> 2 年前
Audio、Screen、StorageStatistic、CustomNotification、AppAccountManager、ArkTSDistributedMusicPlayer ohpm迁移 Signed-off-by: zwx1126739 <zhanghong121@huawei.com> 3 年前
add test case report Signed-off-by: xinking129 <xinxin13@huawei.com> 3 年前
README.md

Distributed Music Player

Introduction

In this sample, fileIo is used to obtain an audio file; AudioPlayer is used to play music, pause the playback, and play the next or previous song; DeviceManager is used to display the distributed device list and hop music playback across devices. The display effect is as follows:

Concepts

Audio playback: The media subsystem provides audio and video services and implements audio playback by using AudioPlayer.

Data hop: The distributed data management module implements collaboration between databases of different devices for applications. The APIs provided by distributed data management can be used to save data to the distributed database and perform operations such as adding, deleting, modifying, and querying data in the distributed database.

Required Permissions

ohos.permission.DISTRIBUTED_DATASYNC

Usage

  1. Play music. Touch the buttons on the music player to play music, pause the playback, and play the next or previous music clip.

  2. Play music across devices. On the Super Device formed by multiple networked devices, touch the Hop button and select a device to play the music on the peer device.

Constraints

  • This sample can only be run on standard-system devices.

  • This sample is based on the stage model, which is supported from API version 9.

  • This sample requires DevEco Studio 3.0 Beta4 (Build Version: 3.0.0.992, built on July 14, 2022) to compile and run.