@ray-js/ray-ipc-player 2.1.2-beta.1 → 2.1.3

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.
Files changed (2) hide show
  1. package/lib/index.js +8 -1
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -265,12 +265,19 @@ const Player = props => {
265
265
  isInBackgroundRef.current = false;
266
266
  if (wasBackground && !ignoreHideStopPreview) {
267
267
  setVideoErrCode('');
268
- if (previewOn) {
268
+ if (previewOn && onlineStatus && !privateState && !limitFlow) {
269
+ // 真正会拉流 → 显示 loading
269
270
  setPlayState(d => {
270
271
  d.loadingState = true;
271
272
  d.errorState = false;
272
273
  d.errorMsg = '';
273
274
  });
275
+ } else {
276
+ // 离线 / 隐私 / 流量限制 / 休眠 → 不拉流,关 loading,交给 ErrorOverlay 按优先级显示提示
277
+ setPlayState(d => {
278
+ d.loadingState = false;
279
+ d.errorState = true;
280
+ });
274
281
  }
275
282
  }
276
283
  getNetworkType({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ray-ipc-player",
3
- "version": "2.1.2-beta.1",
3
+ "version": "2.1.3",
4
4
  "description": "ray小程序播放器",
5
5
  "keywords": [
6
6
  "tuya-miniapp",