@ray-js/ipc-player-integration 0.0.53-beta.4 → 0.0.53-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import { View, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import React, { useContext, useEffect } from 'react';
4
+ import React, { useContext, useEffect, useRef } from 'react';
5
5
  import { useMemoizedFn } from 'ahooks';
6
6
  import { ClarityType } from '@ray-js/ray-ipc-utils/lib/interface';
7
7
  import Strings from '../../i18n';
@@ -31,6 +31,7 @@ export const Resolution = props => {
31
31
  const {
32
32
  event
33
33
  } = useContext(UIEventContext);
34
+ const autoClarityRef = useRef(null);
34
35
 
35
36
  // 广播自动清晰度状态给 VideoBitKBP 等监听方;
36
37
  // 自动模式下监听当前实际清晰度,仅用于码率区域展示。
@@ -42,15 +43,18 @@ export const Resolution = props => {
42
43
  });
43
44
  };
44
45
  if (resolution !== ClarityType.AUTO) {
46
+ autoClarityRef.current = null;
45
47
  emitClarity(false, null);
46
48
  return undefined;
47
49
  }
48
- emitClarity(true, null);
50
+ // 横竖屏切换会重新布局码率区域,重放最近一次实际清晰度,避免前缀丢失。
51
+ emitClarity(true, autoClarityRef.current);
49
52
  if (!devId) return undefined;
50
53
  return subscribeClarityChanged(devId, res => {
54
+ autoClarityRef.current = res.clarity;
51
55
  emitClarity(true, res.clarity);
52
56
  });
53
- }, [devId, event, resolution]);
57
+ }, [devId, event, resolution, screenType]);
54
58
  const onResolution = useMemoizedFn(() => {
55
59
  event.emit(widgetClick, {
56
60
  widgetId: widgetLabs.RESOLUTION
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.53-beta.4",
3
+ "version": "0.0.53-beta.5",
4
4
  "description": "IPC 融合播放器",
5
5
  "main": "lib/index",
6
6
  "files": [