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