优化Video和Map
parent
0b443c8a52
commit
c80dde1826
|
|
@ -34,11 +34,8 @@ const MapSelector = (props) => {
|
||||||
|
|
||||||
// 初始化地图
|
// 初始化地图
|
||||||
const initMap = async () => {
|
const initMap = async () => {
|
||||||
await dynamicLoadJs("https://api.map.baidu.com/api?v=1.0&type=webgl&ak=OElqFYoKiAH8KFtph8ftLKF5NlNrbCUr");
|
|
||||||
|
|
||||||
if (!window.BMapGL) {
|
if (!window.BMapGL) {
|
||||||
console.error("BMapGL is not loaded");
|
await dynamicLoadJs("https://api.map.baidu.com/api?v=1.0&type=webgl&ak=OElqFYoKiAH8KFtph8ftLKF5NlNrbCUr");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|
|
||||||
|
|
@ -44,8 +44,11 @@ const AliPlayer = forwardRef(({
|
||||||
const onCreateAliPlayer = async () => {
|
const onCreateAliPlayer = async () => {
|
||||||
if (!containerRef.current)
|
if (!containerRef.current)
|
||||||
return;
|
return;
|
||||||
|
if (!window.Aliplayer) {
|
||||||
await dynamicLoadJs("https://g.alicdn.com/apsara-media-box/imp-web-player/2.16.3/aliplayer-min.js");
|
await dynamicLoadJs("https://g.alicdn.com/apsara-media-box/imp-web-player/2.16.3/aliplayer-min.js");
|
||||||
await dynamicLoadCss("https://g.alicdn.com/apsara-media-box/imp-web-player/2.16.3/skins/default/aliplayer-min.css");
|
await dynamicLoadCss("https://g.alicdn.com/apsara-media-box/imp-web-player/2.16.3/skins/default/aliplayer-min.css");
|
||||||
|
}
|
||||||
|
|
||||||
onDisposeAliPlayer();
|
onDisposeAliPlayer();
|
||||||
|
|
||||||
const skinLayout = [
|
const skinLayout = [
|
||||||
|
|
@ -79,7 +82,6 @@ const AliPlayer = forwardRef(({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof window.Aliplayer !== "undefined") {
|
|
||||||
playerRef.current = new window.Aliplayer(
|
playerRef.current = new window.Aliplayer(
|
||||||
{
|
{
|
||||||
id: className,
|
id: className,
|
||||||
|
|
@ -123,7 +125,6 @@ const AliPlayer = forwardRef(({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue