





{
"name": "watchkit",
"version": "1.0.0",
"description": "Please describe the basic information.",
"main": "Index.ets",
"author": "",
"license": "Apache-2.0",
"dependencies": {
"@vhall/vhall_live": "1.0.0", // 根据最新发布的版本引入版本号
"@ohos/danmakuflamemaster": "2.0.1",
"@esky/barrage": "1.0.6"
}
}{
"module": {
"name": "watchKit",
"type": "har",
"requestPermissions": [
{"name": "ohos.permission.INTERNET"},
{
"name": "ohos.permission.READ_MEDIA",
"usedScene": {
"abilities": [
"EntryAbility"
],
"when": "inuse"
},
"reason":"$string:read_media"
},
{
"name": "ohos.permission.WRITE_MEDIA",
"usedScene": {
"abilities": [
"EntryAbility"
],
"when": "inuse"
},
"reason":"$string:write_media"
},
{
"name": "ohos.permission.WRITE_IMAGEVIDEO",
"usedScene": {
"abilities": [
"EntryAbility"
],
"when": "inuse"
},
"reason":"$string:write_imagevideo"
},
],
"deviceTypes": [
"default"
],
"routerMap": "$profile:route_map"
}
}
//导入包
import { VHSaaSDK, VHCallBack } from '@vhall/vhall_live'
@Entry
@Component
struct Index {
aboutToAppear(): void {
//获取SDK版本号
VHSaaSDK.getInstance().getVersion();
}
build() {
Navigation(this.pathStack) {
}
.hideToolBar(true)
.hideTitleBar(true)
.width('100%')
.height('100%')
.mode(NavigationMode.Stack)
.id('Login')
}
}主要通过示例展示进入直播前用户需要进行初始化、活动配置信息获取、直播前状态处理。
