Sfoglia il codice sorgente

fix: 修复已知问题

shuisheng 1 anno fa
parent
commit
bb57425ab9

+ 11 - 10
README.md

@@ -22,16 +22,16 @@ billd 直播间,目前实现了类似 [bilibili 的 Web 在线直播](https://
 
 ## 生态
 
-| 名称         | 仓库                                                         | star & fork                                                  | 线上地址                                                     |
-| ------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
-| 直播间前台   | [billd-live](https://github.com/galaxy-s10/billd-live)       | [![github](https://img.shields.io/github/stars/galaxy-s10/billd-live?label=star&logo=GitHub)](https://github.com/galaxy-s10/billd-live) [![github](https://img.shields.io/github/forks/galaxy-s10/billd-live?label=fork&logo=GitHub)](https://github.com/galaxy-s10/billd-live) | [https://live.hsslive.cn](https://live.hsslive.cn)           |
-| 直播间后端   | [billd-live-server](https://github.com/galaxy-s10/billd-live-server) | [![github](https://img.shields.io/github/stars/galaxy-s10/billd-live-server?label=star&logo=GitHub)](https://github.com/galaxy-s10/billd-live-server) [![github](https://img.shields.io/github/forks/galaxy-s10/billd-live-server?label=fork&logo=GitHub)](https://github.com/galaxy-s10/billd-live-server) | [https://live-api.hsslive.cn](https://live-api.hsslive.cn)   |
-| 直播间后台   | [billd-live-admin](https://github.com/galaxy-s10/billd-live-admin) | [![github](https://img.shields.io/github/stars/galaxy-s10/billd-live-admin?label=star&logo=GitHub)](https://github.com/galaxy-s10/billd-live-admin) [![github](https://img.shields.io/github/forks/galaxy-s10/billd-live-admin?label=fork&logo=GitHub)](https://github.com/galaxy-s10/billd-live-admin) | [https://live-admin.hsslive.cn](https://live-admin.hsslive.cn) |
-| 远程桌面     | [billd-desk](https://github.com/galaxy-s10/billd-desk)       | [![github](https://img.shields.io/github/stars/galaxy-s10/billd-desk?label=star&logo=GitHub)](https://github.com/galaxy-s10/billd-desk) [![github](https://img.shields.io/github/forks/galaxy-s10/billd-desk?label=fork&logo=GitHub)](https://github.com/galaxy-s10/billd-desk) | [https://live.hsslive.cn/remoteDeskTop](https://live.hsslive.cn/remoteDeskTop) |
-| 直播间移动端 | [billd-live-react-native](https://github.com/galaxy-s10/billd-live-react-native) | [![github](https://img.shields.io/github/stars/galaxy-s10/billd-live-react-native?label=star&logo=GitHub)](https://github.com/galaxy-s10/billd-live-react-native) [![github](https://img.shields.io/github/forks/galaxy-s10/billd-live-react-native?label=fork&logo=GitHub)](https://github.com/galaxy-s10/billd-live-react-native) | [https://live.hsslive.cn/download](https://live.hsslive.cn/download) |
-| 直播间客户端 | [billd-live-electron](https://github.com/galaxy-s10/billd-live-electron) | [![github](https://img.shields.io/github/stars/galaxy-s10/billd-live-electron?label=star&logo=GitHub)](https://github.com/galaxy-s10/billd-live-flutter) [![github](https://img.shields.io/github/forks/galaxy-s10/billd-live-electron?label=fork&logo=GitHub)](https://github.com/galaxy-s10/billd-live-electron) | [https://live.hsslive.cn/download](https://live.hsslive.cn/download) |
-| 直播间移动端 | [billd-live-flutter](https://github.com/galaxy-s10/billd-live-flutter) | [![github](https://img.shields.io/github/stars/galaxy-s10/billd-live-flutter?label=star&logo=GitHub)](https://github.com/galaxy-s10/billd-live-flutter) [![github](https://img.shields.io/github/forks/galaxy-s10/billd-live-flutter?label=fork&logo=GitHub)](https://github.com/galaxy-s10/billd-live-flutter) | [https://live.hsslive.cn/download](https://live.hsslive.cn/download) |
-| 直播间移动端 | [billd-live-kotlin](https://github.com/galaxy-s10/billd-live-kotlin) | [![github](https://img.shields.io/github/stars/galaxy-s10/billd-live-kotlin?label=star&logo=GitHub)](https://github.com/galaxy-s10/billd-live-kotlin) [![github](https://img.shields.io/github/forks/galaxy-s10/billd-live-kotlin?label=fork&logo=GitHub)](https://github.com/galaxy-s10/billd-live-kotlin) | [https://live.hsslive.cn/download](https://live.hsslive.cn/download) |
+| 名称         | 仓库                                                                             | star & fork                                                                                                                                                                                                                                                                                                                         | 线上地址                                                                       |
+| ------------ | -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
+| 直播间前台   | [billd-live](https://github.com/galaxy-s10/billd-live)                           | [![github](https://img.shields.io/github/stars/galaxy-s10/billd-live?label=star&logo=GitHub)](https://github.com/galaxy-s10/billd-live) [![github](https://img.shields.io/github/forks/galaxy-s10/billd-live?label=fork&logo=GitHub)](https://github.com/galaxy-s10/billd-live)                                                     | [https://live.hsslive.cn](https://live.hsslive.cn)                             |
+| 直播间后端   | [billd-live-server](https://github.com/galaxy-s10/billd-live-server)             | [![github](https://img.shields.io/github/stars/galaxy-s10/billd-live-server?label=star&logo=GitHub)](https://github.com/galaxy-s10/billd-live-server) [![github](https://img.shields.io/github/forks/galaxy-s10/billd-live-server?label=fork&logo=GitHub)](https://github.com/galaxy-s10/billd-live-server)                         | [https://live-api.hsslive.cn](https://live-api.hsslive.cn)                     |
+| 直播间后台   | [billd-live-admin](https://github.com/galaxy-s10/billd-live-admin)               | [![github](https://img.shields.io/github/stars/galaxy-s10/billd-live-admin?label=star&logo=GitHub)](https://github.com/galaxy-s10/billd-live-admin) [![github](https://img.shields.io/github/forks/galaxy-s10/billd-live-admin?label=fork&logo=GitHub)](https://github.com/galaxy-s10/billd-live-admin)                             | [https://live-admin.hsslive.cn](https://live-admin.hsslive.cn)                 |
+| 远程桌面     | [billd-desk](https://github.com/galaxy-s10/billd-desk)                           | [![github](https://img.shields.io/github/stars/galaxy-s10/billd-desk?label=star&logo=GitHub)](https://github.com/galaxy-s10/billd-desk) [![github](https://img.shields.io/github/forks/galaxy-s10/billd-desk?label=fork&logo=GitHub)](https://github.com/galaxy-s10/billd-desk)                                                     | [https://live.hsslive.cn/remoteDeskTop](https://live.hsslive.cn/remoteDeskTop) |
+| 直播间移动端 | [billd-live-flutter](https://github.com/galaxy-s10/billd-live-flutter)           | [![github](https://img.shields.io/github/stars/galaxy-s10/billd-live-flutter?label=star&logo=GitHub)](https://github.com/galaxy-s10/billd-live-flutter) [![github](https://img.shields.io/github/forks/galaxy-s10/billd-live-flutter?label=fork&logo=GitHub)](https://github.com/galaxy-s10/billd-live-flutter)                     | [https://live.hsslive.cn/download](https://live.hsslive.cn/download)           |
+| 直播间移动端 | [billd-live-react-native](https://github.com/galaxy-s10/billd-live-react-native) | [![github](https://img.shields.io/github/stars/galaxy-s10/billd-live-react-native?label=star&logo=GitHub)](https://github.com/galaxy-s10/billd-live-react-native) [![github](https://img.shields.io/github/forks/galaxy-s10/billd-live-react-native?label=fork&logo=GitHub)](https://github.com/galaxy-s10/billd-live-react-native) | [https://live.hsslive.cn/download](https://live.hsslive.cn/download)           |
+| 直播间客户端 | [billd-live-electron](https://github.com/galaxy-s10/billd-live-electron)         | [![github](https://img.shields.io/github/stars/galaxy-s10/billd-live-electron?label=star&logo=GitHub)](https://github.com/galaxy-s10/billd-live-flutter) [![github](https://img.shields.io/github/forks/galaxy-s10/billd-live-electron?label=fork&logo=GitHub)](https://github.com/galaxy-s10/billd-live-electron)                  | [https://live.hsslive.cn/download](https://live.hsslive.cn/download)           |
+| 直播间移动端 | [billd-live-kotlin](https://github.com/galaxy-s10/billd-live-kotlin)             | [![github](https://img.shields.io/github/stars/galaxy-s10/billd-live-kotlin?label=star&logo=GitHub)](https://github.com/galaxy-s10/billd-live-kotlin) [![github](https://img.shields.io/github/forks/galaxy-s10/billd-live-kotlin?label=fork&logo=GitHub)](https://github.com/galaxy-s10/billd-live-kotlin)                         | [https://live.hsslive.cn/download](https://live.hsslive.cn/download)           |
 
 ## 功能
 
@@ -51,6 +51,7 @@ billd 直播间,目前实现了类似 [bilibili 的 Web 在线直播](https://
 - [x] 商品模块
 - [x] 适配移动端
 - [x] 在线后台
+- [x] 多平台转推(b站、虎牙直播)
 - [x] 接入腾讯云-云直播
 - [ ] 接入腾讯云-实时音视频TRTC
 

+ 49 - 1
src/hooks/use-rtcParams.ts

@@ -1,32 +1,41 @@
-import { ref } from 'vue';
+import { ref, watch } from 'vue';
 
+import { DEFAULT_AUTH_INFO } from '@/constant';
 import { MediaTypeEnum } from '@/interface';
+import { useUserStore } from '@/store/user';
 
 export const useRTCParams = () => {
+  const userStore = useUserStore();
   const maxBitrate = ref([
     {
       label: '1',
       value: 1,
+      disabled: false,
     },
     {
       label: '10',
       value: 10,
+      disabled: false,
     },
     {
       label: '1000',
       value: 1000,
+      disabled: false,
     },
     {
       label: '2000',
       value: 2000,
+      disabled: false,
     },
     {
       label: '3000',
       value: 3000,
+      disabled: false,
     },
     {
       label: '4000',
       value: 4000,
+      disabled: true,
     },
     {
       label: '5000',
@@ -53,18 +62,22 @@ export const useRTCParams = () => {
     {
       label: '1帧',
       value: 1,
+      disabled: false,
     },
     {
       label: '10帧',
       value: 10,
+      disabled: false,
     },
     {
       label: '20帧',
       value: 20,
+      disabled: false,
     },
     {
       label: '30帧',
       value: 30,
+      disabled: false,
     },
     {
       label: '60帧',
@@ -81,25 +94,60 @@ export const useRTCParams = () => {
     {
       label: '360P',
       value: 360,
+      disabled: false,
     },
     {
       label: '540P',
       value: 540,
+      disabled: false,
     },
     {
       label: '720P',
       value: 720,
+      disabled: false,
     },
     {
       label: '1080P',
       value: 1080,
+      disabled: false,
     },
     {
       label: '1440P',
       value: 1440,
       disabled: true,
     },
+    {
+      label: '2160P',
+      value: 2160,
+      disabled: true,
+    },
   ]);
+  watch(
+    () => userStore.userInfo,
+    (newval) => {
+      if (newval) {
+        if (
+          userStore.userInfo?.auths?.find(
+            (v) => v.auth_value === DEFAULT_AUTH_INFO.LIVE_PULL_SVIP.auth_value
+          )
+        ) {
+          maxBitrate.value = maxBitrate.value.map((item) => {
+            item.disabled = false;
+            return item;
+          });
+          maxFramerate.value = maxFramerate.value.map((item) => {
+            item.disabled = false;
+            return item;
+          });
+          resolutionRatio.value = resolutionRatio.value.map((item) => {
+            item.disabled = false;
+            return item;
+          });
+        }
+      }
+    },
+    { immediate: true }
+  );
   const allMediaTypeList: Record<string, { type: MediaTypeEnum; txt: string }> =
     {
       [MediaTypeEnum.camera]: {

+ 16 - 6
src/layout/pc/head/index.vue

@@ -577,13 +577,23 @@ function handleStartLive(key: LiveRoomTypeEnum) {
     return;
   }
   if (
-    key === LiveRoomTypeEnum.msr &&
-    !userStore.userInfo?.auths?.find(
-      (v) => v.auth_value === DEFAULT_AUTH_INFO.LIVE_PULL_SVIP.auth_value
-    )
+    [
+      LiveRoomTypeEnum.msr,
+      LiveRoomTypeEnum.tencent_css,
+      LiveRoomTypeEnum.tencent_css_pk,
+      LiveRoomTypeEnum.forward_all,
+      LiveRoomTypeEnum.forward_bilibili,
+      LiveRoomTypeEnum.forward_huya,
+    ].includes(key)
   ) {
-    window.$message.info('权限不足,请更换其他开播方式');
-    return;
+    if (
+      !userStore.userInfo?.auths?.find(
+        (v) => v.auth_value === DEFAULT_AUTH_INFO.LIVE_PULL_SVIP.auth_value
+      )
+    ) {
+      window.$message.info('权限不足,请更换其他开播方式');
+      return;
+    }
   }
   const url = router.resolve({
     name: routerName.push,

+ 13 - 8
src/views/push/index.vue

@@ -372,7 +372,8 @@
         </div> -->
       </div>
     </div>
-
+  </div>
+  <div>
     <SelectMediaModalCpt
       v-if="showSelectMediaModalCpt"
       :all-media-type-list="allMediaTypeList"
@@ -1333,7 +1334,7 @@ function initCanvas() {
  * 二倍屏展示:100px等于100个像素,二比一展示,即在二倍屏的100px看起来会比一倍屏的100px小一倍
  * 如果需要在一杯和二倍屏幕的时候看的大小都一样:
  * 1,在二倍屏的时候,需要将100px放大一倍,即200px;
- * 2,在一倍屏的时候,需要将100px缩小一,即50px;
+ * 2,在一倍屏的时候,需要将100px缩小一,即50px;
  */
 function handleScaling({ canvasDom, id }) {
   canvasDom.on('scaling', () => {
@@ -1482,7 +1483,9 @@ async function handleCache() {
           );
           handleMoving({ canvasDom, id: obj.id });
           handleScaling({ canvasDom, id: obj.id });
-          canvasDom.scale(item.scaleInfo[window.devicePixelRatio].scaleX || 1);
+          canvasDom.scale(
+            item.scaleInfo?.[window.devicePixelRatio]?.scaleX || 1
+          );
           canvasDom.opacity = item.openEye ? 1 : 0;
           fabricCanvas.value.add(canvasDom);
           obj.canvasDom = canvasDom;
@@ -1524,7 +1527,7 @@ async function handleCache() {
             handleMoving({ canvasDom, id: item.id });
             handleScaling({ canvasDom, id: item.id });
             canvasDom.scale(
-              item.scaleInfo[window.devicePixelRatio].scaleX || 1
+              item.scaleInfo?.[window.devicePixelRatio]?.scaleX || 1
             );
             canvasDom.opacity = item.openEye ? 1 : 0;
             fabricCanvas.value!.add(canvasDom);
@@ -1589,7 +1592,9 @@ async function handleCache() {
           );
           handleMoving({ canvasDom, id: item.id });
           handleScaling({ canvasDom, id: item.id });
-          canvasDom.scale(item.scaleInfo[window.devicePixelRatio].scaleX || 1);
+          canvasDom.scale(
+            item.scaleInfo?.[window.devicePixelRatio]?.scaleX || 1
+          );
           canvasDom.opacity = item.openEye ? 1 : 0;
           fabricCanvas.value!.add(canvasDom);
           obj.videoEl = videoEl;
@@ -1627,7 +1632,7 @@ async function handleCache() {
         handleMoving({ canvasDom, id: obj.id });
         handleScaling({ canvasDom, id: obj.id });
         // fabric.Text类型不能除以分辨率
-        canvasDom.scale(item.scaleInfo[window.devicePixelRatio].scaleX);
+        canvasDom.scale(item.scaleInfo?.[window.devicePixelRatio]?.scaleX || 1);
         canvasDom.opacity = item.openEye ? 1 : 0;
         fabricCanvas.value.add(canvasDom);
         obj.canvasDom = canvasDom;
@@ -1647,7 +1652,7 @@ async function handleCache() {
         handleMoving({ canvasDom, id: obj.id });
         handleScaling({ canvasDom, id: obj.id });
         // fabric.Text类型不能除以分辨率
-        canvasDom.scale(item.scaleInfo[window.devicePixelRatio].scaleX);
+        canvasDom.scale(item.scaleInfo?.[window.devicePixelRatio]?.scaleX || 1);
         canvasDom.opacity = item.openEye ? 1 : 0;
         fabricCanvas.value.add(canvasDom);
         obj.canvasDom = canvasDom;
@@ -1667,7 +1672,7 @@ async function handleCache() {
         handleMoving({ canvasDom, id: obj.id });
         handleScaling({ canvasDom, id: obj.id });
         // fabric.Text类型不能除以分辨率
-        canvasDom.scale(item.scaleInfo[window.devicePixelRatio].scaleX);
+        canvasDom.scale(item.scaleInfo?.[window.devicePixelRatio]?.scaleX || 1);
         canvasDom.opacity = item.openEye ? 1 : 0;
         fabricCanvas.value.add(canvasDom);
         obj.canvasDom = canvasDom;

+ 5 - 1
src/views/push/mediaModal/index.vue

@@ -23,7 +23,10 @@
         <div class="item">
           <div class="label">名称</div>
           <div class="value">
-            <n-input v-model:value="mediaName" />
+            <n-input
+              type="textarea"
+              v-model:value="mediaName"
+            />
           </div>
         </div>
         <template v-if="props.mediaType === MediaTypeEnum.txt && txtInfo">
@@ -31,6 +34,7 @@
             <div class="label">内容</div>
             <div class="value">
               <n-input
+                type="textarea"
                 ref="inputInstRef"
                 v-model:value="txtInfo.txt"
               />