Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8813f73

Browse files
author
邵强强
committed
style: fmt
1 parent ba9dc7d commit 8813f73

File tree

1 file changed

+79
-77
lines changed

1 file changed

+79
-77
lines changed

demos/vue3-demo/src/components/EZUIKitJs.vue

Lines changed: 79 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,123 +1,125 @@
11
<script lang="ts" setup>
2-
import EZUIKit from 'ezuikit-js'
3-
import { onMounted } from 'vue'
2+
import EZUIKit from "ezuikit-js";
3+
import { onMounted } from "vue";
44
55
interface IPlayer {
6-
play: Function
7-
stop: Function
8-
getOSDTime: Function
9-
capturePicture: Function
10-
openSound: Function
11-
closeSound: Function
12-
startSave: Function
13-
stopSave: Function
14-
startTalk: Function
15-
stopTalk: Function
16-
fullScreen: Function
17-
destroy: Function
6+
play: Function;
7+
stop: Function;
8+
getOSDTime: Function;
9+
capturePicture: Function;
10+
openSound: Function;
11+
closeSound: Function;
12+
startSave: Function;
13+
stopSave: Function;
14+
startTalk: Function;
15+
stopTalk: Function;
16+
fullScreen: Function;
17+
destroy: Function;
1818
}
1919
20-
let player:IPlayer
20+
let player: IPlayer;
2121
2222
const play = () => {
23-
const playPromise = player.play()
23+
const playPromise = player.play();
2424
playPromise.then((data: any) => {
25-
console.log('promise 获取 数据', data)
26-
})
27-
}
25+
console.log("promise 获取 数据", data);
26+
});
27+
};
2828
2929
const stop = () => {
30-
const stopPromise = player.stop()
30+
const stopPromise = player.stop();
3131
stopPromise.then((data: any) => {
32-
console.log('promise 获取 数据', data)
33-
})
34-
}
32+
console.log("promise 获取 数据", data);
33+
});
34+
};
3535
3636
const getOSDTime = () => {
37-
const getOSDTimePromise = player.getOSDTime()
37+
const getOSDTimePromise = player.getOSDTime();
3838
getOSDTimePromise.then((data: any) => {
39-
console.log('promise 获取 数据', data)
40-
})
41-
}
39+
console.log("promise 获取 数据", data);
40+
});
41+
};
4242
4343
const capturePicture = () => {
44-
const capturePicturePromise = player.capturePicture(`${new Date().getTime()}`)
44+
const capturePicturePromise = player.capturePicture(
45+
`${new Date().getTime()}`
46+
);
4547
capturePicturePromise.then((data: any) => {
46-
console.log('promise 获取 数据', data)
47-
})
48-
}
48+
console.log("promise 获取 数据", data);
49+
});
50+
};
4951
5052
const openSound = () => {
51-
const openSoundPromise = player.openSound()
53+
const openSoundPromise = player.openSound();
5254
openSoundPromise.then((data: any) => {
53-
console.log('promise 获取 数据', data)
54-
})
55-
}
55+
console.log("promise 获取 数据", data);
56+
});
57+
};
5658
5759
const closeSound = () => {
58-
const openSoundPromise = player.closeSound()
60+
const openSoundPromise = player.closeSound();
5961
openSoundPromise.then((data: any) => {
60-
console.log('promise 获取 数据', data)
61-
})
62-
}
62+
console.log("promise 获取 数据", data);
63+
});
64+
};
6365
6466
const startSave = () => {
65-
const startSavePromise = player.startSave(`${new Date().getTime()}`)
67+
const startSavePromise = player.startSave(`${new Date().getTime()}`);
6668
startSavePromise.then((data: any) => {
67-
console.log('promise 获取 数据', data)
68-
})
69-
}
69+
console.log("promise 获取 数据", data);
70+
});
71+
};
7072
7173
const stopSave = () => {
72-
const stopSavePromise = player.stopSave()
74+
const stopSavePromise = player.stopSave();
7375
stopSavePromise.then((data: any) => {
74-
console.log('promise 获取 数据', data)
75-
})
76-
}
76+
console.log("promise 获取 数据", data);
77+
});
78+
};
7779
7880
const ezopenStartTalk = () => {
79-
player.startTalk()
80-
}
81+
player.startTalk();
82+
};
8183
8284
const ezopenStopTalk = () => {
83-
player.stopTalk()
84-
}
85+
player.stopTalk();
86+
};
8587
8688
const fullScreen = () => {
87-
player.fullScreen()
88-
}
89+
player.fullScreen();
90+
};
8991
9092
const destroy = () => {
91-
const destroyPromise = player.destroy()
93+
const destroyPromise = player.destroy();
9294
destroyPromise.then((data: any) => {
93-
console.log('promise 获取 数据', data)
94-
})
95-
}
95+
console.log("promise 获取 数据", data);
96+
});
97+
};
9698
9799
onMounted(() => {
98-
console.group('mounted 组件挂载完毕状态===============》')
99-
fetch('https://open.ys7.com/jssdk/ezopen/demo/token')
100-
.then(response => response.json())
101-
.then(res => {
102-
var accessToken = res.data.accessToken;
103-
player = new EZUIKit.EZUIKitPlayer({
104-
id: 'video-container', // 视频容器ID
105-
accessToken: accessToken,
106-
url: 'ezopen://open.ys7.com/G39444019/1.live',
107-
// simple - 极简版; pcLive-pc直播;pcRec-pc回放;mobileLive-移动端直播;mobileRec-移动端回放;security - 安防版;voice-语音版;
108-
//template: 'simple',
109-
plugin: ['talk'], // 加载插件,talk-对讲
110-
width: 600,
111-
height: 400,
112-
})
113-
window.player = player
114-
})
115-
})
100+
console.group("mounted 组件挂载完毕状态===============》");
101+
fetch("https://open.ys7.com/jssdk/ezopen/demo/token")
102+
.then((response) => response.json())
103+
.then((res) => {
104+
var accessToken = res.data.accessToken;
105+
player = new EZUIKit.EZUIKitPlayer({
106+
id: "video-container", // 视频容器ID
107+
accessToken: accessToken,
108+
url: "ezopen://open.ys7.com/G39444019/1.live",
109+
// simple - 极简版; pcLive-pc直播;pcRec-pc回放;mobileLive-移动端直播;mobileRec-移动端回放;security - 安防版;voice-语音版;
110+
//template: 'simple',
111+
plugin: ["talk"], // 加载插件,talk-对讲
112+
width: 600,
113+
height: 400,
114+
});
115+
window.player = player;
116+
});
117+
});
116118
</script>
117119

118120
<template>
119-
<div class="hello-ezuikit-js">
120-
<div id="video-container" style="width:600px;height:400px"></div>
121+
<div class="hello-ezuikit-js">
122+
<div id="video-container" style="width: 600px; height: 400px"></div>
121123
<div>
122124
<button @click="stop">stop</button>
123125
<button @click="play">play</button>

0 commit comments

Comments
 (0)