HarmonyOS web播放在线音频demo?

如题:HarmonyOS web播放在线音频demo?

阅读 660
1 个回答

示例如下:

import { webview } from '@kit.ArkWeb'

@Entry
@Component
struct Index {
  private webviewController: WebviewController = new webview.WebviewController();

  build() {
    RelativeContainer() {
      Web({
        controller:this.webviewController,
        src:"https://s.wcd.im/v/dqjjvZ71/?chl=7m"
      }).javaScriptAccess(true).domStorageAccess(true).fileAccess(true).imageAccess(true).mixedMode(MixedMode.All).databaseAccess(true)
    }
    .height('100%')
    .width('100%')
  }
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进