zy-react-library 1.0.131 → 1.0.132

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.
@@ -34,11 +34,8 @@ const MapSelector = (props) => {
34
34
 
35
35
  // 初始化地图
36
36
  const initMap = async () => {
37
- await dynamicLoadJs("https://api.map.baidu.com/api?v=1.0&type=webgl&ak=OElqFYoKiAH8KFtph8ftLKF5NlNrbCUr");
38
-
39
37
  if (!window.BMapGL) {
40
- console.error("BMapGL is not loaded");
41
- return;
38
+ await dynamicLoadJs("https://api.map.baidu.com/api?v=1.0&type=webgl&ak=OElqFYoKiAH8KFtph8ftLKF5NlNrbCUr");
42
39
  }
43
40
 
44
41
  setLoading(true);
@@ -44,8 +44,11 @@ const AliPlayer = forwardRef(({
44
44
  const onCreateAliPlayer = async () => {
45
45
  if (!containerRef.current)
46
46
  return;
47
- await dynamicLoadJs("https://g.alicdn.com/apsara-media-box/imp-web-player/2.16.3/aliplayer-min.js");
48
- await dynamicLoadCss("https://g.alicdn.com/apsara-media-box/imp-web-player/2.16.3/skins/default/aliplayer-min.css");
47
+ if (!window.Aliplayer) {
48
+ await dynamicLoadJs("https://g.alicdn.com/apsara-media-box/imp-web-player/2.16.3/aliplayer-min.js");
49
+ await dynamicLoadCss("https://g.alicdn.com/apsara-media-box/imp-web-player/2.16.3/skins/default/aliplayer-min.css");
50
+ }
51
+
49
52
  onDisposeAliPlayer();
50
53
 
51
54
  const skinLayout = [
@@ -79,51 +82,49 @@ const AliPlayer = forwardRef(({
79
82
  });
80
83
  }
81
84
 
82
- if (typeof window.Aliplayer !== "undefined") {
83
- playerRef.current = new window.Aliplayer(
84
- {
85
- id: className,
86
- ...(source
87
- ? { source }
88
- : {
89
- vid,
90
- playauth: playAuth,
91
- qualitySort: "asc",
92
- format: "m3u8",
93
- encryptType: 1,
94
- mediaType: "video",
95
- isLive: true,
96
- rePlay: false,
97
- playsinline: true,
98
- controlBarVisibility: "hover",
99
- }),
100
- cover,
101
- width,
102
- height,
103
- autoplay,
104
- isLive,
105
- useH5Prism: true,
106
- skinLayout,
107
- },
108
- (player) => {
109
- if (autoplay) {
110
- player.play();
111
- }
112
-
113
- player.on("ended", () => {
114
- onEnded && onEnded();
115
- });
116
-
117
- player.on("timeupdate", () => {
118
- onTimeupdate && onTimeupdate(player.getCurrentTime());
119
- });
120
-
121
- if (playTime > 0) {
122
- player.seek(playTime);
123
- }
124
- },
125
- );
126
- }
85
+ playerRef.current = new window.Aliplayer(
86
+ {
87
+ id: className,
88
+ ...(source
89
+ ? { source }
90
+ : {
91
+ vid,
92
+ playauth: playAuth,
93
+ qualitySort: "asc",
94
+ format: "m3u8",
95
+ encryptType: 1,
96
+ mediaType: "video",
97
+ isLive: true,
98
+ rePlay: false,
99
+ playsinline: true,
100
+ controlBarVisibility: "hover",
101
+ }),
102
+ cover,
103
+ width,
104
+ height,
105
+ autoplay,
106
+ isLive,
107
+ useH5Prism: true,
108
+ skinLayout,
109
+ },
110
+ (player) => {
111
+ if (autoplay) {
112
+ player.play();
113
+ }
114
+
115
+ player.on("ended", () => {
116
+ onEnded && onEnded();
117
+ });
118
+
119
+ player.on("timeupdate", () => {
120
+ onTimeupdate && onTimeupdate(player.getCurrentTime());
121
+ });
122
+
123
+ if (playTime > 0) {
124
+ player.seek(playTime);
125
+ }
126
+ },
127
+ );
127
128
  };
128
129
 
129
130
  useEffect(() => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zy-react-library",
3
3
  "private": false,
4
- "version": "1.0.131",
4
+ "version": "1.0.132",
5
5
  "type": "module",
6
6
  "description": "",
7
7
  "author": "LiuJiaNan",