The current repo belongs to Closed status, and some functions are restricted. For details, please refer to the description of repo status
145 Star 1.4K Fork 1.7K

OpenHarmony/applications_app_samples
Closed

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
.gitee
code
AI/MindSporeLiteCDemoASR
ArkTS1.2
BasicFeature
DataMock
DocsSample
LanguageBaseClassLibrary
Performance
Project
Solutions
SuperFeature
DistributedAppDev
ArkTSDistributedCalc
ArkTSDistributedMusicPlayer
AppScope
entry
hvigor
screenshots/device
signature
.gitignore
README.md
README_zh.md
build-profile.json5
hvigorfile.js
oh-package.json5
ohosTest.md
DistributeCalc
DistributedFilemanager
DistributedJotNote
DistributedNote
DistributedRdb
JsDistributedMusicPlayer
Kvstore
MultiDeviceAppDev
Widget
SystemFeature
UI
.gitattributes
.gitignore
CodeCommitChecklist.md
LICENSE
OAT.xml
README.md
README_zh.md
SampleReadTemplate.md
changelog.md
ohosTestTemplate.md
releasenote.md
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README

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.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openharmony/applications_app_samples.git
git@gitee.com:openharmony/applications_app_samples.git
openharmony
applications_app_samples
applications_app_samples
master

Search