当前位置: 首页 > wzjs >正文

阿里巴巴免费做网站吗wordpress客户端linux

阿里巴巴免费做网站吗,wordpress客户端linux,苏州seo排名优化课程,中国建设部网站查询网需求:需要在大屏上播放萤石视频,用到官方的ezuikit-js插件实现,并实现视频播放切换功能。有个问题至今没有解决,就是萤石视频的宽高是固定的,不会根据大屏缩放进行自适应。我这边做了简单的刷新自适应。 1.下载ezuikit…

需求:需要在大屏上播放萤石视频,用到官方的ezuikit-js插件实现,并实现视频播放切换功能。有个问题至今没有解决,就是萤石视频的宽高是固定的,不会根据大屏缩放进行自适应。我这边做了简单的刷新自适应。

1.下载ezuikit-js

我在这下载的是0.7.2版本,最新版已经到8+,但是下载后运行报错了,可能不适配vue2,稳点就下载这个版本就行

ezuikit-js - npm

npm install ezuikit-js@0.7.2 --save

 2.效果如下

token和url都是官网拷贝的,所以播放不了,项目中改为有效果的token即可

3.主要代码讲解

首先肯定是引入

我们使用第二种引入即可

// >= v8.1.2  ESM
import { EZUIKitPlayer } from "ezuikit-js";// < v8.1.2
import EZUIKit from "ezuikit-js";

主要方法:

  1. player.play();播放

  2. player.stop();停止播放

  3. player.openSound();停止声音

  4. player.closeSound();关闭声音

  5. player.fullScreen();全屏

  6. player.cancelFullScreen();关闭全屏

  7. player.destroy()销毁视频

  8. player.changePlayUrl({})切换视频

视频播放主要就是如下代码,env一般不设置, template: 'pcLive',可以设置视频最底部的操作栏,this.$refs.videoContainer就是获取父级的盒子的宽高之后每次刷新页面都根据父级的宽高设置视频的宽高

        <div class="video-box" ref="videoContainer"><div id="video-container"></div></div>init() {if (player) {this.destroy();}const findItms = this.videos.find((item) => item.id === this.videoSelect);const container = this.$refs.videoContainer;console.log(container.clientWidth, container.clientHeight, '最大值和最小值');player = new EZUIKit.EZUIKitPlayer({id: 'video-container', // 视频容器IDaccessToken: findItms.accessToken,url: findItms.address,// simple: 极简版; pcLive: pc直播; pcRec: pc回放; mobileLive: 移动端直播; mobileRec: 移动端回放;security: 安防版; voice: 语音版;template: 'pcLive',// plugin: ["talk"], // 加载插件,talk-对讲width: container.clientWidth,height: container.clientHeight,handleError: (error) => {console.error('handleError', error);},// language: "en", // zh | en// staticPath: "/ezuikit_static", // 如果想使用本地静态资源,请复制根目录下ezuikit_static 到当前目录下, 然后设置该值env: {// https://open.ys7.com/help/1772?h=domain// domain默认是 https://open.ys7.com, 如果是私有化部署或海外的环境,请配置对应的domain// The default domain is https://open.ys7.com If it is a private deployment or overseas (outside of China) environment, please configure the corresponding domaindomain: 'https://open.ys7.com'}});window.player = player;},.video-box {width: 30vw;height: 30vh;
}

3.1效果如下

3.2切换视频

只需要使用changePlayUrl方法之后传token和地址就可以了

       changeVideo(val) {console.log(val, '-----');let options = this.videos.find((item) => item.id == val);player.changePlayUrl({// minHeight: 100, // 视频最小高度,单位为pxaccessToken: options.accessToken, //accessToken 的值为你在莹石云平台监控地址的tokenurl: options.address}).then(() => {console.log('切换成功');});},

4.完整代码

<template><div class="hello-ezuikit-js"><el-selectstyle="margin: 30px 0px"v-model="videoSelect":teleported="false"popper-class="popperClass"placeholder="请选择"size="mini"@change="changeVideo"><el-option v-for="(item, index) in videos" :key="item.index" :label="item.name" :value="item.id"> </el-option></el-select><div class="video-box" ref="videoContainer"><div id="video-container"></div></div><div><button v-on:click="init">初始化视频</button><button v-on:click="stop">停止视频</button><button v-on:click="play">开始播放</button></div></div>
</template><script>
import EZUIKit from 'ezuikit-js';
var player = null;export default {name: 'HelloWorld',props: {msg: String},data() {return {videoSelect: 1,videos: [{id: 1,accessToken: 'at.3bvmj4ycamlgdwgw1ig1jruma0wpohl6-48zifyb39c-13t5am6-yukyi86mz',name: '视频11',address: 'ezopen://open.ys7.com/BD3957004/1.live'},{id: 2,name: '视频12',accessToken: 'at.1gskp9sk9b8pol288qw4f0ladj6ow00a-2obk8zrvgd-0icd73x',address: 'ezopen://open.ys7.com/BC7900686/1.hd.live'}]};},mounted: () => {console.group('mounted 组件挂载完毕状态===============》');},methods: {init() {if (player) {this.destroy();}const findItms = this.videos.find((item) => item.id === this.videoSelect);const container = this.$refs.videoContainer;console.log(container.clientWidth, container.clientHeight, '最大值和最小值');player = new EZUIKit.EZUIKitPlayer({id: 'video-container', // 视频容器IDaccessToken: findItms.accessToken,url: findItms.address,// simple: 极简版; pcLive: pc直播; pcRec: pc回放; mobileLive: 移动端直播; mobileRec: 移动端回放;security: 安防版; voice: 语音版;template: 'pcLive',// plugin: ["talk"], // 加载插件,talk-对讲width: container.clientWidth,height: container.clientHeight,handleError: (error) => {console.error('handleError', error);},// language: "en", // zh | en// staticPath: "/ezuikit_static", // 如果想使用本地静态资源,请复制根目录下ezuikit_static 到当前目录下, 然后设置该值env: {// https://open.ys7.com/help/1772?h=domain// domain默认是 https://open.ys7.com, 如果是私有化部署或海外的环境,请配置对应的domain// The default domain is https://open.ys7.com If it is a private deployment or overseas (outside of China) environment, please configure the corresponding domaindomain: 'https://open.ys7.com'}});window.player = player;},play() {var playPromise = player.play();playPromise.then((data) => {console.log('promise 获取 数据', data);});},stop() {var stopPromise = player.stop();stopPromise.then((data) => {console.log('promise 获取 数据', data);});},changeVideo(val) {console.log(val, '-----');let options = this.videos.find((item) => item.id == val);player.changePlayUrl({// minHeight: 100, // 视频最小高度,单位为pxaccessToken: options.accessToken, //accessToken 的值为你在莹石云平台监控地址的tokenurl: options.address}).then(() => {console.log('切换成功');});},destroy() {var destroyPromise = player.destroy();destroyPromise.then((data) => {console.log('promise 获取 数据', data);});player = null;}}
};
</script>
<style lang="scss" scoped>
.hello-ezuikit-js {height: 700px;width: 100%;
}
.video-box {width: 30vw;height: 30vh;
}
</style>

文章到此结束,希望对你有所帮助~


文章转载自:

http://CdeQdK1b.csxLm.cn
http://URHY3BQc.csxLm.cn
http://KcGhdwM3.csxLm.cn
http://Q73qCzgA.csxLm.cn
http://Z327Ufoh.csxLm.cn
http://MaWfpsJU.csxLm.cn
http://KZN7WbTv.csxLm.cn
http://aFqr0drq.csxLm.cn
http://c5jzanku.csxLm.cn
http://UxBnmERr.csxLm.cn
http://izW1M5Hw.csxLm.cn
http://923XKKJX.csxLm.cn
http://AGvQ9r6Y.csxLm.cn
http://6yygLM5Y.csxLm.cn
http://kjOKmTZS.csxLm.cn
http://dy7l6zzx.csxLm.cn
http://4YG4xOrn.csxLm.cn
http://Fk08Puwv.csxLm.cn
http://3PAnX9yO.csxLm.cn
http://BX43wmMK.csxLm.cn
http://sQxP9szG.csxLm.cn
http://H0NUd4gQ.csxLm.cn
http://YKs7UDKT.csxLm.cn
http://ygPYOkhx.csxLm.cn
http://nMhXoiSE.csxLm.cn
http://OwOTLkax.csxLm.cn
http://iwhitOlP.csxLm.cn
http://Cb44j7JC.csxLm.cn
http://RBGBy6C9.csxLm.cn
http://3zuZGsLl.csxLm.cn
http://www.dtcms.com/wzjs/622128.html

相关文章:

  • 泉州企业网站开发ps制作个人网站首页
  • 毕业设计网站建设英文文献网站建设内容策略有哪些
  • 页面简单的网站模板免费下载怎么查看网站建设时间
  • 安徽网站建设怎么样在越南注册公司需要什么条件
  • 专业的公司网站制作服务网站后台文章排版
  • 创客贴设计网站官网滨江网站建设公司
  • seo建设网站做前后端网站教程
  • 免费网站注册comwordpress island
  • 网站方案模板某企业网站建设论文
  • 公司网站建设的要点dw软件怎么下载
  • 阳泉住房和城乡建设部网站wordpress的版本号
  • 英语网站都可以做哪些内容看p站用什么浏览器
  • 小猪网站怎么做的河南省建协网官方网站
  • 应届生出来做网站还是做报纸好手机软件开发的模式
  • 网站的域名能修改么百科网站建设
  • 怎样免费做公司网站电子元器件商城官网
  • 微信分销网站建设平台电商类网站模板下载
  • 点餐网站怎么做怎么用php源代码做网站
  • 乐陵网站制作网站设计高度
  • 网站开发实训教程360免费wifi可以破解wifi密码吗
  • 权威的网站建设公司网络上哪里可以做推广
  • 教怎么做糕点网站江苏高端网站建设
  • 好的文化网站模板下载网站用图要怎么做
  • 自已的电脑怎么做网站网业协同机制
  • 大连网站建设信息logo制作软件手机免费版
  • 郑州网站建设亻汉狮网络在线网站代码生成
  • 网站建设 天佩营销wordpress网站提速
  • 西宁网站托管宁波网站建设公司推荐哪家
  • 网站调整方案seo研究中心怎么了
  • 房产经济人怎么做网站网站网址查询ip