From 8de8b893488ac5444ad47d81c494cd73a091f95c Mon Sep 17 00:00:00 2001 From: bai <1643359946@qq.com> Date: Mon, 24 Apr 2023 17:23:07 +0800 Subject: [PATCH] =?UTF-8?q?2023=E5=B9=B44=E6=9C=8824=E6=97=A5=20=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E4=B8=BArtmp=E7=9B=B4=E6=92=AD=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 1 + index.html | 4 + package.json | 2 + src/main.ts | 2 + src/router/routes/modules/site/site.ts | 20 +- src/views/kc/jiaoshi/index.vue | 211 +++---------- src/views/kc/jiaoshi/index.vue.bak | 282 ++++++++++++++++++ src/views/site/common/header.vue | 4 +- src/views/site/common/video/flvjs/index.vue | 78 +++++ src/views/site/common/video/videojs/index.vue | 83 ++++++ src/views/site/common/video/videojs/util.ts | 32 ++ src/views/site/common/video/videojs/video.vue | 66 ++++ src/views/site/common/video/webRTC/index.vue | 52 ++++ src/views/site/common/webRTC/index.vue | 3 + 14 files changed, 668 insertions(+), 172 deletions(-) create mode 100644 src/views/kc/jiaoshi/index.vue.bak create mode 100644 src/views/site/common/video/flvjs/index.vue create mode 100644 src/views/site/common/video/videojs/index.vue create mode 100644 src/views/site/common/video/videojs/util.ts create mode 100644 src/views/site/common/video/videojs/video.vue create mode 100644 src/views/site/common/video/webRTC/index.vue diff --git a/.eslintrc.js b/.eslintrc.js index 063d2fe..92ff354 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -81,5 +81,6 @@ module.exports = defineConfig({ 'vue/no-deprecated-v-on-native-modifier': 'off', 'vue/no-v-html': 'off', 'prefer-const': 'off', + 'no-irregular-whitespace': 'off', }, }); diff --git a/index.html b/index.html index e8a5af3..1002be3 100644 --- a/index.html +++ b/index.html @@ -28,6 +28,8 @@ theme = htmlRoot = null; } })(); + + window.HELP_IMPROVE_VIDEOJS = false;
\ No newline at end of file diff --git a/src/views/site/common/header.vue b/src/views/site/common/header.vue index 8103016..62fa779 100644 --- a/src/views/site/common/header.vue +++ b/src/views/site/common/header.vue @@ -17,7 +17,9 @@
{{ projectName }} - + + + diff --git a/src/views/site/common/video/flvjs/index.vue b/src/views/site/common/video/flvjs/index.vue new file mode 100644 index 0000000..7f08e68 --- /dev/null +++ b/src/views/site/common/video/flvjs/index.vue @@ -0,0 +1,78 @@ + + + \ No newline at end of file diff --git a/src/views/site/common/video/videojs/index.vue b/src/views/site/common/video/videojs/index.vue new file mode 100644 index 0000000..587e6a6 --- /dev/null +++ b/src/views/site/common/video/videojs/index.vue @@ -0,0 +1,83 @@ + + + \ No newline at end of file diff --git a/src/views/site/common/video/videojs/util.ts b/src/views/site/common/video/videojs/util.ts new file mode 100644 index 0000000..353579f --- /dev/null +++ b/src/views/site/common/video/videojs/util.ts @@ -0,0 +1,32 @@ +// import { ref, nextTick, onBeforeUnmount} from 'vue'; + +// export const rtcServerUrl = import.meta.env.VITE_GLOB_RTC_SERVER; + +export function getDefOptions(object) { + // const windowObj = window; + // const WebRtcStreamer = windowObj.WebRtcStreamer; + let o = { + autoplay: true, + controls: true, + muted: true, + errorDisplay: false, + preload: 'auto', + language: 'zh-CN', + aspectRatio: "16:9", + fluid: true, + liveui: true, + hotkeys: false, + // playbackRates: [1,2,3,4,5,8,10,20], + trechIrder: ['flash'], + // sources: [{ + // // type: 'rtmp/flv', + // // src: 'rtmp://127.0.0.1:1935/live/soures', + // type: 'application/x-mpegURL', + // src: 'http://127.0.0.1/live_hls/soures.m3u8', + // }], + flash: { + swf: 'https://cnd.bootcdn.net/ajax/libs/videojs-swf/5.4.2/video-js.swf', + } + }; + return Object.assign(o,object); +} diff --git a/src/views/site/common/video/videojs/video.vue b/src/views/site/common/video/videojs/video.vue new file mode 100644 index 0000000..a91e411 --- /dev/null +++ b/src/views/site/common/video/videojs/video.vue @@ -0,0 +1,66 @@ + + + \ No newline at end of file diff --git a/src/views/site/common/video/webRTC/index.vue b/src/views/site/common/video/webRTC/index.vue new file mode 100644 index 0000000..a246300 --- /dev/null +++ b/src/views/site/common/video/webRTC/index.vue @@ -0,0 +1,52 @@ + + + \ No newline at end of file diff --git a/src/views/site/common/webRTC/index.vue b/src/views/site/common/webRTC/index.vue index 862422b..7d6a10d 100644 --- a/src/views/site/common/webRTC/index.vue +++ b/src/views/site/common/webRTC/index.vue @@ -4,6 +4,9 @@ +