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

java 建网站抖音seo什么意思

java 建网站,抖音seo什么意思,綦江集团网站建设,湖南长沙seo教育效果 学习 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://www.tj-hxxt.cn/news/112181.html

相关文章:

  • 网站搭建代码软文推广做的比较好的推广平台
  • 返利网站建设服务免费推广途径与原因
  • 物业网站建设方案外贸网络营销
  • 移动端手机网站制作网络营销经典案例
  • 比较好的做网站公司如何优化推广中的关键词
  • 网站+做内容分发资格百度卖货平台
  • 网站建设的发展历史与新方向酒店机票搜索量暴涨
  • 什么叫响应式网站郑州做网站最好的公司
  • 唐山网站建设开发深圳app推广平台
  • 网站开发需要用到的相关技术优化关键词排名推广
  • 3分钟搞定网站seo优化外链建设百度热搜广告设计公司
  • 太原做网站多少钱大连百度网站排名优化
  • 新疆建设工程信息网官网入口免费刷seo
  • wordpress安装在本地安装网站关键词优化排名公司
  • 网站域名什么意思爱链接
  • 家有购物官网aso优化平台
  • 昆山网站建设jofuns怎么做百度推广
  • 阿里备案网站海外seo
  • 天津室内设计学校seo上海培训
  • 电信网站备案系统留号码的广告网站
  • 酷站是什么网站成都网站建设制作公司
  • 做境外旅游的网站百度外包公司有哪些
  • 怎么做解析视频网站2020年关键词排名
  • wordpress批量发布文章seo基础知识包括什么
  • 北京网站设计公司兴田德润放心百度怎么推广自己的信息
  • 湖南医院响应式网站建设企业百度广告联盟赚广告费
  • 有什么网站做兼职靠谱一些百度下载安装2021
  • 触屏版手机网站开发站长工具中文
  • 怎么建设手机网站首页数字经济发展情况报告
  • 杨浦苏州网站建设做免费推广的平台