seagazer / ccplayer

A media player for OpenHarmony & HarmonyOS.
Apache License 2.0
12 stars 3 forks source link

brightness与控制声音的api过期了,编译不通过。 #6

Closed csh159 closed 2 months ago

seagazer commented 4 months ago

你好,能提供下编译报错的版本信息吗。目前最新版本在oh fullsdk5.0.0.25上编译是通过的

csh159 commented 4 months ago

开发工具:5.0.3.300 sdk:4.1.0(11)

Morzorz commented 4 months ago

版本信息:HarmonyOS NEXT Developer Beta1 SDK, based on OpenHarmony SDK Ohos_sdk_public 5.0.0.25 (API Version 12 Beta1)

Morzorz commented 4 months ago

编译报错:1. Cannot find module '@ohos.brightness' or its corresponding type declarations. 2.Property 'setVolume' does not exist on type 'AudioVolumeGroupManager'. Did you mean 'getVolume'?

seagazer commented 4 months ago

编译报错:1. Cannot find module '@ohos.brightness' or its corresponding type declarations. 2.Property 'setVolume' does not exist on type 'AudioVolumeGroupManager'. Did you mean 'getVolume'?

开发工具:5.0.3.300 sdk:4.1.0(11)

开发者你好,是因为音量和亮度属于系统接口,对三方应用隐藏,HarmonyOS Next目前提供的publicSdk没有开放该系统接口能力。解决方式可以参考之前:https://github.com/seagazer/ccplayer/issues/2。 当前最新代码中已经提供了裁剪版的PlayerView组件供使用(next和OpenHarmony publicSdk版本,不支持亮度和音量设置),而CcPlayerView为OpenHarmony系统应用专用组件(OpenHarmony fullSdk版本,支持调用系统接口设置亮度和音量)