Jessibuca 插件播放直播流视频

jessibuca官网:http://jessibuca.monibuca.com/player.html
git地址:https://gitee.com/huangz2350_admin/jessibuca#https://gitee.com/link?target=http%3A%2F%2Fjessibuca.monibuca.com%2F
项目需要的文件
在这里插入图片描述
在这里插入图片描述

1.播放组件

<template ><div id="jessibuca" style="width: auto; height: auto; position: relative" @mouseover="showbtn"><div :id="'container' + index" ref="container" :style="'position: relative;width: 100%; height:' +height +'; background:url(' +  background +') no-repeat;background-size: 100% 100%;background-color: #000;'" @dblclick="fullscreenSwich"><div :id="'buttonsBox' + index" class="buttons-box" style="position: absolute; left: 0; bottom: 0"><div class="buttons-box-left"><i v-if="!playing" class="iconfont icon-play jessibuca-btn" @click="playBtnClick" /><i v-if="playing" class="iconfont icon-pause jessibuca-btn" @click="pause" /><i class="iconfont icon-stop jessibuca-btn" @click="destroy" /><i v-if="isNotMute" class="iconfont icon-audio-high jessibuca-btn" @click="jessibuca.mute()" /><i v-if="!isNotMute" class="iconfont icon-audio-mute jessibuca-btn" @click="jessibuca.cancelMute()" /></div><div class="buttons-box-right"><span class="jessibuca-btn">{{ kBps }} kb/s</span><!--          <i class="iconfont icon-file-record1 jessibuca-btn"></i>--><!--          <i class="iconfont icon-xiangqing2 jessibuca-btn" ></i>--><i class="iconfont icon-camera1196054easyiconnet jessibuca-btn"@click="jessibuca.screenshot('截图', 'png', 0.5)" /><i class="iconfont icon-shuaxin11 jessibuca-btn" @click="playBtnClick" /><i v-if="!fullscreen" class="iconfont icon-weibiaoti10 jessibuca-btn" @click="fullscreenSwich" /><i v-if="fullscreen" class="iconfont icon-weibiaoti11 jessibuca-btn" @click="fullscreenSwich" /></div></div></div><div v-if="!playing && !autoplay" class="btn-image" :style="'height:' + height"><div class="btn-image-center" @click="playBtnClick" :style="'width:' +btnimageW +';height: ' +btnimageH +';background:url(' +btnimage +') no-repeat;background-size: 100% 100%;'"></div></div></div>
</template><script>
/* eslint-disable no-underscore-dangle */
export default {name: 'Jessibuca',props: {index: {//indextype: Number,default: 0,},videoUrl: {//播放地址type: String,default: '',},error: {//报错信息type: Function,default: null,},hasAudio: {//静音type: Boolean,default: false,},height: {//播放器高度type: String,default: '500px',},isFullResize: {//播放面即是否填充满容器type: Boolean,default: true,},autoplay: {//是否自动播放type: Boolean,default: false,},background: {//封面图type: String,default: '',},btnimage: {//播放器按钮图片type: String,default: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAADUNJREFUeF7tnV+MHVUdx3/n3pVNbRFLDJhaNCG6pRAkWCUttrJYWtGAQXSlu3Nmob17Z7bFJVIUaQjtm4kv1KQktbcrone2JFYl8RlsrGLwwRhJ/MMfX4360IdiQuu6c8y5u9tdWpbemXPmN2fOfJv0bX6/3/l9fvPJ3Dn37owg/AMBEFiRgAAbEACBlQlAEJwdIPAeBCAITg8QgCA4B0AgHwFcQfJxQ1RNCECQmgwabeYjAEHycUNUTQhAkJoMGm3mIwBB8nFDVE0IQJCaDBpt5iMAQfJxQ1RNCECQmgwabeYjAEHycUNUTQhAkJoMGm3mIwBB8nFDVE0IsAkyNhZ/otlM19WEK9oskMDcXOMfJ04ce6PAEhdSFyZIEMTbhVD3CUE3KUWbiOgDHA2hRm0InBWC/qAU/VmIxgvd7g9+VUTnhQgiZfQ0ET1axIKREwRWIHA4STr7bdOxLoiU0WtENGR7ocgHAn0QeD1JOhv6OK7vQ6wKImV8mkht67s6DgQB+wROJ0nnDltprQkShnFLKTVta2HIAwJ5CSilWjMzx5/NG788zoogo6PxlmZT/c7GgpADBGwQUCrdMjMz/YppLiuCBEH7qBBi0nQxiAcBiwSOJklnn2k+K4JIGb1MRLebLgbxIGCPgHo5SY5vNc1nS5C3iGiN6WIQDwIWCbyVJB3j796MBQnDiY1KNf5isTGkAgErBAYGaONzz3X+ZpLMWBApJ4aJGqdMFoFYECiCgBBquNs9/muT3BDEhB5inSYAQZweDxZXNgEIUvYEUN9pAhDE6fFgcWUTgCBlTwD1n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6V5nmsiRI+xSRGDZdDOJBwBYBIehUt9v5vGk+K4IEQfSMEPSw6WIQDwIWCTyTJJ0p03yWBIm3C6FeNF0M4kHAFgGlxF0zM8deMs1nRRC9CCkj/e7wR00XhHgQsEDgcJJ09lvIQ9YEWZBE72YN2VgYcoBATgKvJ0lnQ87YS8KsCjIvSXyaSG2ztUDkAYEMBE4nSeeODMdf9lDrguiKYRi3lFLTl62OA0DAEgEh0olud/qHltJdSFOIIDr76Gi8pdFIx4UQnyQi/X+N7cUjX60J/IeIXiWiPymV/mRmZvqVImgUJsjFiw3DiY1K0bVFNIGc9SIgBP2r253+K0fXbIJwNIMaIGCbAASxTRT5vCIAQbwaJ5qxTQCC2CaKfF4RgCBejRPN2CYAQWwTRT6vCEAQr8aJZmwTgCC2iSKfVwQgiFfjRDO2CUAQ20SRzysCEMSrcaIZ2wQgiG2iyOcVAQji1TjRjG0CEMQ2UeTzigAE8WqcaMY2AQhimyjyeUXg/3DQ3hQovnZyAAAAAElFTkSuQmCC',},btnimageH: {//播放器按钮图片高度type: String,default: '60px',},btnimageW: {//播放器按钮图片宽度type: String,default: '60px',},},data() {return {jessibuca: null,playing: false,isNotMute: false,quieting: false,fullscreen: false,loaded: false, // mutespeed: 0,performance: '', // 工作情况kBps: 0,btnDom: null,videoInfo: null,volume: 1,rotate: 0,vod: true, // 点播forceNoOffscreen: false,}},watch: {videoUrl: {handler(newData, oldData) {if (!this.autoplay && !oldData) returnthis.play(newData)},},},mounted() {window.onerror = (msg) => {// console.error(msg)}const paramUrl = decodeURIComponent(this.$route.params.url)this.$nextTick(() => {if (typeof this.videoUrl === 'undefined') {this.videoUrl = paramUrl}this.btnDom = document.getElementById('buttonsBox' + this.index)console.log(`初始化时的地址为: ${this.videoUrl}`)this.autoplay ? this.play(this.videoUrl) : ''})},destroyed() {if (this.jessibuca) {this.jessibuca.destroy()}this.playing = false// this.loaded = falsethis.performance = ''},methods: {create() {const options = {}console.log(this.$refs.container)console.log(`hasAudio  ${this.hasAudio}`)this.jessibuca = new window.Jessibuca(Object.assign({container: this.$refs.container,videoBuffer: 0.5, // 最大缓冲时长,单位秒isResize: true,isFlv: true,decoder: '/js/jessibuca/index.js',// text: "WVP-PRO",// background: "bg.jpg",loadingText: '加载中',hasAudio:typeof this.hasAudio === 'undefined' ? true : this.hasAudio,debug: false,supportDblclickFullscreen: false, // 是否支持屏幕的双击事件,触发全屏,取消全屏事件。operateBtns: {fullscreen: false,screenshot: false,play: false,audio: false,},record: 'record',isFullResize: this.isFullResize || false,vod: this.vod,forceNoOffscreen: this.forceNoOffscreen,isNotMute: this.isNotMute,},options))// eslint-disable-next-line no-underscore-dangleconst _this = thisthis.jessibuca.on('load', () => {console.log('on load init')})this.jessibuca.on('log', (msg) => {console.log('on log', msg)})this.jessibuca.on('record', (msg) => {console.log('on record:', msg)})this.jessibuca.on('pause', () => {_this.playing = false})this.jessibuca.on('play', () => {_this.playing = true})this.jessibuca.on('fullscreen', (msg) => {console.log('on fullscreen', msg)_this.fullscreen = msg})this.jessibuca.on('mute', (msg) => {console.log('on mute', msg)_this.isNotMute = !msg})this.jessibuca.on('audioInfo', (msg) => {// console.log("audioInfo", msg);})this.jessibuca.on('videoInfo', function (msg) {this.videoInfo = msg// console.log("videoInfo", msg);})this.jessibuca.on('bps', (bps) => {// console.log('bps', bps);})// eslint-disable-next-line no-unused-varslet _ts = 0this.jessibuca.on('timeUpdate', (ts) => {// console.log('timeUpdate,old,new,timestamp', _ts, ts, ts - _ts);_ts = ts})this.jessibuca.on('videoInfo', (info) => {console.log('videoInfo', info)})this.jessibuca.on('error', (error) => {console.log('error', error)})this.jessibuca.on('timeout', () => {console.log('timeout')})this.jessibuca.on('start', () => {console.log('start')})this.jessibuca.on('performance', (performance) => {let show = '卡顿'if (performance === 2) {show = '非常流畅'} else if (performance === 1) {show = '流畅'}_this.performance = show})this.jessibuca.on('buffer', (buffer) => {// console.log('buffer', buffer);})this.jessibuca.on('stats', (stats) => {// console.log('stats', stats);})this.jessibuca.on('kBps', (kBps) => {_this.kBps = Math.round(kBps)})// 显示时间戳 PTSthis.jessibuca.on('videoFrame', () => { })//this.jessibuca.on('metadata', () => { })},playBtnClick(event) {this.play(this.videoUrl)},play(url) {if (!url || url.length == 0) {this.$message.warning('当前摄像头出错,请稍后重试')this.pause()return}if (this.jessibuca) {this.destroy()}this.create()this.jessibuca.on('play', () => {this.playing = true// this.loaded = true// this.quieting = this.jessibuca.quieting})if (this.jessibuca.hasLoaded()) {this.jessibuca.play(url)} else {this.jessibuca.on('load', () => {console.log('load 播放')this.jessibuca.play(url)})}},pause() {if (this.jessibuca) {this.jessibuca.pause()}this.playing = falsethis.err = ''this.performance = ''},destroy() {if (this.jessibuca) {this.jessibuca.destroy()}if (document.getElementById('buttonsBox' + this.index) == null) {document.getElementById('container' + this.index).appendChild(this.btnDom)}this.jessibuca = nullthis.playing = falsethis.err = ''this.performance = ''},showbtn() {if (document.getElementById('buttonsBox' + this.index) == null) {document.getElementById('container' + this.index).appendChild(this.btnDom)}},eventcallbacK(type, message) {// console.log("player 事件回调")// console.log(type)// console.log(message)},fullscreenSwich() {const isFull = this.isFullscreen()this.jessibuca.setFullscreen(!isFull)this.fullscreen = !isFull},isFullscreen() {return (document.fullscreenElement ||document.msFullscreenElement ||document.mozFullScreenElement ||document.webkitFullscreenElement ||false)},},
}
</script><style>
@font-face {font-family: 'iconfont';/* Project id 1291092 */src: url('iconfont.woff2') format('woff2');
}.iconfont {font-family: 'iconfont' !important;font-size: 16px;font-style: normal;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;
}.icon-play:before {content: '\e603';
}.icon-pause:before {content: '\e6c6';
}.icon-stop:before {content: '\e6a8';
}.icon-audio-high:before {content: '\e793';
}.icon-audio-mute:before {content: '\e792';
}.icon-shuaxin11:before {content: '\e720';
}.icon-weibiaoti10:before {content: '\e78f';
}.icon-weibiaoti11:before {content: '\e790';
}.icon-camera1196054easyiconnet:before {content: '\e791';
}.buttons-box {width: 100%;height: 0px;transition: 0.4s;background-color: rgba(43, 51, 63, 0.7);display: -webkit-box;display: -ms-flexbox;display: flex;user-select: none;z-index: 100;display: flex;align-items: center;overflow: hidden;
}#jessibuca:hover .buttons-box {height: 40px;
}.buttons-box-left {display: flex;flex: 1;align-items: center;
}.jessibuca-btn {color: rgb(255, 255, 255);line-height: 27px;margin: 0px 5px;padding: 0px 2px;cursor: pointer;text-align: center;font-size: 20px !important;
}.buttons-box-right {height: 100%;position: absolute;right: 0;display: flex;flex: 1;align-items: center;font-size: 20px;
}.btn-image {width: 100%;/* height: 100%; */position: absolute;left: 0;top: 0;z-index: 99 !important;
}.btn-image-center {position: absolute;left: 0;right: 0;bottom: 0;top: 0;margin: auto;
}
</style>
.jessibuca-btn 设置播放控件的间距
decoder: '/js/jessibuca/index.js',地址是服务静态文件的相对地址src: url('iconfont.woff2') format('woff2'); 相对地址 iconfont.woff2需要和组件放在同一目录下

2.父组件引用

<template><div class="app-container"><player video-url="视频地址" :has-audio="false" height="200px" :isFullResize="false" :autoplay="true":index="getIndex" /></div>
</template>
<script>
import player from '@/components/jessibuca/index.vue' // h265播放器export default {name: 'video',components: {player,},data() {return {}},computed: {// 获取时间戳getIndex() {let time = new Date().getTime()return time},},
}
</script>

3.index.html 需要引入静态js文件

<script src="./public/js/jessibuca/index.js"></script>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/264641.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【深入理解设计模式】适配器设计模式

适配器设计模式 适配器设计模式是一种结构型设计模式&#xff0c;用于将一个类的接口转换成客户端所期望的另一个接口&#xff0c;从而使得原本由于接口不兼容而不能一起工作的类能够一起工作。适配器模式通常用于以下场景&#xff1a; 现有接口与需求不匹配&#xff1a;当需要…

【力扣 - 买卖股票的最佳时机】

题目描述 给定一个数组 prices &#xff0c;它的第 i 个元素 prices[i] 表示一支给定股票第 i 天的价格。 你只能选择 某一天 买入这只股票&#xff0c;并选择在 未来的某一个不同的日子 卖出该股票。设计一个算法来计算你所能获取的最大利润。 返回你可以从这笔交易中获取的…

【Linux深入剖析】进程优先级 | 命令行参数 | 环境变量

&#x1f4d9; 作者简介 &#xff1a;RO-BERRY &#x1f4d7; 学习方向&#xff1a;致力于C、C、数据结构、TCP/IP、数据库等等一系列知识 &#x1f4d2; 日后方向 : 偏向于CPP开发以及大数据方向&#xff0c;欢迎各位关注&#xff0c;谢谢各位的支持 目录 1.进程优先级2.Linux…

【MySQL面试复习】详细说下事务的特性

系列文章目录 在MySQL中&#xff0c;如何定位慢查询&#xff1f; 发现了某个SQL语句执行很慢&#xff0c;如何进行分析&#xff1f; 了解过索引吗&#xff1f;(索引的底层原理)/B 树和B树的区别是什么&#xff1f; 什么是聚簇索引&#xff08;聚集索引&#xff09;和非聚簇索引…

Unity(第六部)向量的理解和算法

标量:只有大小的量。185 888 999 &#xff08;类似坐标&#xff09; 向量:既有大小&#xff0c;也有方向。&#xff08;类似以个体为主体的方向&#xff0c;前方一百米&#xff09; 向量的模:向量的大小。&#xff08;类似以个体为主体的方向&#xff0c;前方一百米、只取一百米…

Leetcoder Day23| 回溯part03:组合+分割

语言&#xff1a;Java/Go 39. 组合总和 给你一个 无重复元素 的整数数组 candidates 和一个目标整数 target &#xff0c;找出 candidates 中可以使数字和为目标数 target 的所有不同组合 &#xff0c;并以列表形式返回。你可以按任意顺序返回这些组合。 candidates 中的同一个…

状态机-----

1.原理 同步的意思就是状态的跳转都是在时钟的作用下跳转的&#xff0c;有限是指状态机中状态的个数是有限的。两种状态机的共同点都是状态的跳转只和输入有关&#xff0c;区别就是如果最后的输出只和当前状态有关而与输入无关&#xff0c;则是moore型状态机。如果最后的输出不…

Go 如何按行读取(大)文件?尝试 bufio 包提供的几种方式

嗨&#xff0c;大家好&#xff01;我是波罗学。本文是系列文章 Go 技巧第十七篇&#xff0c;系列文章查看&#xff1a;Go 语言技巧。 本文将介绍 Go 如何按行读取文件&#xff0c;基于此会逐步延伸到如何按块读取文件。 引言 我们将要介绍的按行读取文件的方式其实是非常适合…

Laravel04 eloquent

eloquent 1. eloquent2. 创建eloquent model 以及 取数据 1. eloquent 文档地址&#xff1a; https://learnku.com/docs/laravel/8.x/eloquent/9406 下面是我们&#xff0c;通过laravel的DB类从数据库中获取了post记录&#xff0c;那么有没有可能我们直接获取一个post对象&am…

pycharm控制STM32F103ZET6拍照并上位机接收显示(OV7670、照相机、STM32、TFTLCD)

基于STM32的照相机 准备工作最终效果一、下位机1、主函数2、OV7670初始化 二、上位机1、控制拍照2、接收图片数据 三、资源获取 准备工作 一、硬件及片上资源: 1,串口1(波特率:921600,PA9/PA10通过usb转ttl连接电脑&#xff0c;或者其他方法)上传图片数据至上位机 2,串口2(波特…

一文读懂:AWS 网络对等互连(VPC peering)实用操作指南

VPC peering connection-网络对等互连在您的 Atlas VPC 和云提供商的 VPC 之间建立私有连接。该连接将流量与公共网络隔离以提高安全性。本篇文章有VPC peering的操作指南以及价格等信息。如还有疑问请联系我们MongoDB的销售&#xff0c;客户成功经理或解决方案架构师。 1 使用…

【C之·预处理器】

系列文章目录 文章目录 前言一、预处理指令1. #line的用法1.1 概述 2. #error2.1 概述 二、预定义宏三、示例1. #line2. #error3. 预定义宏 总结 前言 C 预处理器不是编译器的组成部分&#xff0c;但是它是编译过程中一个单独的步骤。简言之&#xff0c;C 预处理器只不过是一个…

C++面试宝典第32题:零钱兑换

题目 给定不同面额的硬币coins和一个总金额amount,编写一个函数来计算可以凑成总金额所需的最少的硬币个数。如果没有任何一种硬币组合能组成总金额,则返回-1。说明:你可以认为每种硬币的数量是无限的。 示例1: 输入:coins = [1, 2, 5], amount = 11 输出:3 解释:11 = …

如何使用Douglas-042为威胁搜索和事件应急响应提速

关于Douglas-042 Douglas-042是一款功能强大的PowerShell脚本&#xff0c;该脚本可以提升数据分类的速度&#xff0c;并辅助广大研究人员迅速从取证数据中筛选和提取出关键数据。 该工具能够搜索和识别Windows生态系统中潜在的安全漏洞&#xff0c;Douglas-042会将注意力放在…

Mistral发布语言大模型Mistral Large;法国新星Mistral挑战 OpenAI 霸主地位

&#x1f989; AI新闻 &#x1f680; Mistral发布语言大模型Mistral Large 摘要&#xff1a;Mistral Large 是 Mistral AI 公司最新发布的旗舰语言模型&#xff0c;具备顶尖水平的推理能力。它主要被设计用于处理复杂的多语言推理任务&#xff0c;比如文本理解、转换和代码生…

HTTP---------状态码

当服务端返回 HTTP 响应时&#xff0c;会带有一个状态码&#xff0c;用于表示特定的请求结果。比如 HTTP/1.1 200 OK&#xff0c;里面的 HTTP/1.1 表示协议版本&#xff0c;200 则是状态码&#xff0c;OK 则是对状态码的描述。 由协议版本、状态码、描述信息组成的行被称为起始…

【算法与数据结构】684、685、LeetCode冗余连接I II

文章目录 一、684、冗余连接 I二、685、冗余连接 II三、完整代码 所有的LeetCode题解索引&#xff0c;可以看这篇文章——【算法和数据结构】LeetCode题解。 一、684、冗余连接 I 思路分析&#xff1a;题目给出一个无向有环图&#xff0c;要求去掉一个边以后构成一个树&#xf…

【iOS ARKit】ARWorldMap

ARWorldMap 用于存储 ARSession 检测扫描到的空间信息数据&#xff0c;包括地标&#xff08;Landmark&#xff09;、特征点&#xff08;Feature Point&#xff09;、平面&#xff08;Plane&#xff09;等&#xff0c;以及使用者的操作信息&#xff0c;如使用者添加的 ARAnchor …

【非比较排序】计算排序算法

目录 CountSort计数排序 整体思想 图解分析 代码实现 时间复杂度&优缺分析 CountSort计数排序 计数排序是一种非比较排序&#xff0c;不需要像前面的排序一样去比较。 计数排序的特性总结&#xff1a; 1. 计数排序在数据范围集中时&#xff0c;效率很高&#xff0c;但…

golang gin单独部署vue3.0前后端分离应用

概述 因为公司最近的项目前端使用vue 3.0&#xff0c;后端api使用golang gin框架。测试通过后&#xff0c;博文记录&#xff0c;用于备忘。 步骤 npm run build&#xff0c;构建出前端项目的dist目录&#xff0c;dist目录的结构具体如下图 将dist目录复制到后端程序同级目录…