1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <template>
- <view class="shipin">
- <div id="video-container" class="myplayer" ref="myPlayer" @click="noclick"></div>
- </view>
- </template>
- <script>
- import EZUIKit from "../../../../utils/ezuikit.js";
- var player = null;
- export default {
- data() {
- return {
- urls:'',
- width:'',
- }
- },
- onLoad(options) {
- this.urls = options.companyOrgId;
- console.log( this.urls);
- this.accessToken();
- this.width = uni.getSystemInfoSync().screenWidth;
- console.log('111111111111111111', uni.getSystemInfoSync().screenWidth)
- },
-
- methods: {
- accessToken(){
-
- var postdata ={
- 'appKey': 'bf1fe258e25b4556af2889b53cf2d835',
- 'appSecret': 'f814b3ce1653f7f909b6ccc358563fb3'
- };
-
- uni.request({
- url:'https://open.ys7.com/api/lapp/token/get',
- method: "POST",
- data: postdata,
- header: {
- 'content-type': 'application/x-www-form-urlencoded',
- },
- success: (res) => {
- // console.log('111111111111111111',res.data.data.accessToken)
-
- player = new EZUIKit.EZUIKitPlayer({
- id: 'video-container', // 视频容器ID
- accessToken: res.data.data.accessToken,
- url:this.urls,
- // simple - 极简版; pcLive-pc直播;pcRec-pc回放;mobileLive-移动端直播;mobileRec-移动端回放;security - 安防版;voice-语音版;
- template: 'simple',
- plugin: ['talk'], // 加载插件,talk-对讲
- width:this.width,
- height: 250,
- autoplay: true,
- // decoderPath: EZUIKit,
-
- });
- window.player = player;
-
- }
- });
-
-
-
- }
- }
- }
- </script>
- <style>
- .shipin{
- width: 750rpx;
- height: 100%;
- }
- #video-container{
- width: 750rpx;
- height: 600rpx;
- }
- </style>
|