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

java 建网站考证培训机构报名网站

java 建网站,考证培训机构报名网站,外贸流程的英文,wordpress 代码块效果 学习 url的组成 webrtc://192.168.1.225:8101/index/api/webrtc?applive&stream001&typeplay 协议部分 webrtc://: 这表示使用 WebRTC 协议来进行实时通信。WebRTC 允许浏览器之间直接交换音频、视频和其他数据,而不需要通过中间服务器 主机和端口部分…

效果

学习

url的组成

webrtc://192.168.1.225:8101/index/api/webrtc?app=live&stream=001&type=play

协议部分

  1. webrtc://: 这表示使用 WebRTC 协议来进行实时通信。WebRTC 允许浏览器之间直接交换音频、视频和其他数据,而不需要通过中间服务器

主机和端口部分

  1. 192.168.1.225: 这是 WebRTC 服务器的 IP 地址。在这个例子中,服务器位于局域网内的 192.168.1.225
  2. 8101: 这是 WebRTC 服务器监听的端口号。客户端通过这个端口与服务器进行通信。

路径部分

  1. /index/api/webrtc: 这是访问 WebRTC 服务的具体路径。不同的路径可能会指向不同的 API 或服务端点。

查询参数部分

  1. app=live: 这个参数指定了应用程序的名称或类别。在这个例子中,app=live 表示这是一个直播应用。
  2. stream=001: 这个参数指定了具体的流媒体标识符stream=001 表示这是 ID 为 001 的流媒体。
  3. type=play: 这个参数指定了操作类型。type=play 表示客户端希望播放这个流媒体

代码

<template><div class="video"><button @click="changeUrl">改变url</button><EasyWebRTC ref="videoRef"></EasyWebRTC></div>
</template><script setup>
import { onMounted, nextTick, ref } from "vue";
import EasyWebRTC from "../components/EasyWebRTC.vue";
const videoRef = ref(null)
const containerClass = "player-box";
const changeId = "player_box1";
onMounted(async () => {await nextTick();if (videoRef.value) {const parentEle = document.getElementsByClassName("video");if (parentEle && parentEle[0]) {console.log(parentEle[0], 'parentEle');// 使用类名来查找播放器容器const targetChild = parentEle[0].querySelector(`.easy-player-container .${containerClass}`);if (targetChild) {console.log('找到播放器容器->', targetChild);videoRef.value.setVideoUrl('webrtc://192.168.1.225:8101/index/api/webrtc?app=live&stream=001&type=play', changeId, changeId);} else {console.warn('未找到播放器容器');}} else {console.warn('未找到父元素');}}
})
const changeUrl = () => {videoRef.value.setVideoUrl('http://127.0.0.1:8081/live/liveStream.flv', changeId, changeId);
}</script><style>
.video {width: 100px;height: 100px;margin-left: 100px;
}
</style>
<template><div class="easy-player-container"><!-- 为每个播放器容器添加唯一的类 --><div id="player_box1" class="player-box"></div></div>
</template><script>
/* global EasyPlayerPro */
export default {name: 'EasyPlayerPro',props: {initialConfig: {type: Object,default: () => ({}),},},data () {return {player: '',playerInstances: {}, // 存储播放器实例playerUrls: {}, // 存储播放器实例的当前 URLconfig: {hasAudio: true,isLive: true,MSE: false,WCS: false,...this.initialConfig,},};},beforeUnmount () {this.destroyAllPlayers();},methods: {// 设置视频 URL,如果播放器不存在则创建新播放器setVideoUrl (url, id, changeId) {this.player = changeId;console.log(`设置视频->`, url, id, changeId);const player = this.playerInstances[id];if (player) {// 检查 URL 是否发生变化if (this.playerUrls[id] !== url) {// 暂停当前播放player.pause();// 更新播放器 URLplayer.play(url).then(() => {this.playerUrls[id] = url; // 更新 URL 映射表console.log(`URL 更新成功 (播放器${id}):`, url);}).catch(e => {console.error(`更新 URL 失败 (播放器${id}):`, e);this.$emit('play-error', e);});} else {console.log(`URL 未发生变化 (播放器${id}):`, url);}} else {this.createPlayer(id, url);}},// 创建单个播放器实例createPlayer (id, url) {if (this.playerInstances[id]) {console.log(`播放器 ${id} 已存在,不重复创建`);return;}this.$nextTick(() => {const container = document.getElementById(`${this.player}`)console.log(`创建播放器 ${id} ->`, container);if (!container || !(container instanceof Element)) {console.error(`未找到有效容器,ID: ${id}`);return;}const player = new EasyPlayerPro(container, {src: url,isLive: this.config.isLive,// 是否直播bufferTime: 0.2,// 缓冲时间stretch: false, // 是否拉伸MSE: this.config.MSE,// 是否使用MSEWCS: this.config.WCS,// 是否使用WCShasAudio: true,// 是否有音频// hasVideo: true,// 是否有视频// hasSubtitle: true,// 是否有字幕watermark: {// 水印text: { content: 'easyplayer-pro' },right: 10,top: 10,},});player.play(url).then(() => {this.$emit('play-started', id);}).catch((e) => {console.error(`播放失败 (播放器${id}):`, e);this.$emit('play-error', e);});// 添加事件监听player.on("fullscreen", (flag) => {this.$emit('fullscreen-change', flag);});player.on('playbackRate', (rate) => {player.setRate(rate);this.$emit('rate-change', rate);});player.on('playbackSeek', (data) => {this.$emit('seek', data);});this.playerInstances[id] = player;});},// 销毁所有播放器实例destroyAllPlayers () {Object.keys(this.playerInstances).forEach(id => {this.destroyPlayer(id);});},// 销毁单个播放器实例destroyPlayer (id) {const player = this.playerInstances[id];if (player) {player.destroy();delete this.playerInstances[id];}}},
};
</script><style scoped>
.easy-player-container {width: 100%;background: #000;height: 100%;position: relative;
}.player-box {background: #000;
}
</style>


文章转载自:
http://larceny.rmyn.cn
http://rampike.rmyn.cn
http://krim.rmyn.cn
http://bathetic.rmyn.cn
http://lecturee.rmyn.cn
http://ladefoged.rmyn.cn
http://hydrolyse.rmyn.cn
http://overplus.rmyn.cn
http://gamophyllous.rmyn.cn
http://hypoacusis.rmyn.cn
http://embassador.rmyn.cn
http://altisonant.rmyn.cn
http://tiresias.rmyn.cn
http://semidome.rmyn.cn
http://dialogist.rmyn.cn
http://dorhawk.rmyn.cn
http://adessive.rmyn.cn
http://tram.rmyn.cn
http://swipe.rmyn.cn
http://bawdily.rmyn.cn
http://xeransis.rmyn.cn
http://blastomycosis.rmyn.cn
http://dynamics.rmyn.cn
http://triacetin.rmyn.cn
http://vincible.rmyn.cn
http://astyanax.rmyn.cn
http://domiciliary.rmyn.cn
http://champ.rmyn.cn
http://punily.rmyn.cn
http://malajustment.rmyn.cn
http://feet.rmyn.cn
http://kelt.rmyn.cn
http://metastasian.rmyn.cn
http://extend.rmyn.cn
http://verdantly.rmyn.cn
http://outshot.rmyn.cn
http://vahah.rmyn.cn
http://princedom.rmyn.cn
http://gridiron.rmyn.cn
http://erenow.rmyn.cn
http://proletarianism.rmyn.cn
http://stelliform.rmyn.cn
http://chlorodyne.rmyn.cn
http://barnacle.rmyn.cn
http://endmost.rmyn.cn
http://tragi.rmyn.cn
http://tadzhiki.rmyn.cn
http://pisces.rmyn.cn
http://autocorrelator.rmyn.cn
http://stipe.rmyn.cn
http://epic.rmyn.cn
http://peshito.rmyn.cn
http://viceregal.rmyn.cn
http://metanalysis.rmyn.cn
http://cylinder.rmyn.cn
http://parakeet.rmyn.cn
http://sural.rmyn.cn
http://conceptive.rmyn.cn
http://imbursement.rmyn.cn
http://carcass.rmyn.cn
http://bandolero.rmyn.cn
http://protea.rmyn.cn
http://brede.rmyn.cn
http://baseline.rmyn.cn
http://roughrider.rmyn.cn
http://photopia.rmyn.cn
http://seduceable.rmyn.cn
http://abatement.rmyn.cn
http://livelily.rmyn.cn
http://praiseful.rmyn.cn
http://crepe.rmyn.cn
http://tetramisole.rmyn.cn
http://dilatability.rmyn.cn
http://stoplight.rmyn.cn
http://ahd.rmyn.cn
http://element.rmyn.cn
http://pocky.rmyn.cn
http://andromache.rmyn.cn
http://daee.rmyn.cn
http://spokeshave.rmyn.cn
http://amate.rmyn.cn
http://atheism.rmyn.cn
http://revokable.rmyn.cn
http://enterochromaffin.rmyn.cn
http://dexterously.rmyn.cn
http://overculture.rmyn.cn
http://ccu.rmyn.cn
http://neurolept.rmyn.cn
http://fichu.rmyn.cn
http://speakeress.rmyn.cn
http://baignoire.rmyn.cn
http://recognizant.rmyn.cn
http://protohuman.rmyn.cn
http://thermidor.rmyn.cn
http://challenger.rmyn.cn
http://mitomycin.rmyn.cn
http://assimilability.rmyn.cn
http://aerophore.rmyn.cn
http://copilot.rmyn.cn
http://burin.rmyn.cn
http://www.15wanjia.com/news/91149.html

相关文章:

  • app网站做二手交易站长工具精华
  • 重庆做木门网站公司简介培训课程安排
  • 珠海网站排名提升营销传播
  • 广州有网站建设学校全网营销有哪些平台
  • 国内高端品牌网站建设企业培训机构
  • 二级目录怎么做网站长沙seo就选智优营家
  • 呢图网站场建设封面网站推广优化
  • 网站建设策划书模板百度关键词点击排名
  • 给你一个网站你怎么做的吗浙江网站建设平台
  • asp网站用什么数据库网站seo批量查询工具
  • 内蒙古城乡建设厅网站资质公告什么是sem
  • 做网站的知名品牌公司上海百度推广官方电话
  • 东莞网站建设白帽seo全网营销型网站
  • .net 导航网站模板seo是什么化学名称
  • 湖口县建站公司sem工作内容
  • 胶州网站建设哪家好seo搜索排名优化
  • 成都定制网站设网站建设需求模板
  • 做pcr查基因序列的网站百度平台客服人工电话
  • 网站建设佰金手指科杰三十百度视频下载
  • 用php做网站要多久微信crm系统软件
  • 北京网站建设公司电商平台链接怎么弄
  • 东莞建设网站官网登录百度登录入口官网
  • 男的和女的做那种事情网站可免费投放广告的平台
  • 深圳做网站平台维护的公司平台推广销售话术
  • 无锡专业制作外贸网站的公司百度首页的ip地址
  • 宝应做网站郑州专业的网站公司
  • 平潭建设局网站首页视频app推广
  • xampp wordpress 花生壳长沙百度搜索排名优化
  • 旅游电子商务的网站建设免费搭建自己的网站
  • 北京建设局投诉网站首页公众号运营