|
@@ -42,11 +42,7 @@ export interface VideoSceneProps {
|
|
|
loop?: boolean;
|
|
|
volume?: number;
|
|
|
};
|
|
|
- /**
|
|
|
- * 视图属性,参数见文档
|
|
|
- * @see https://krpano.com/docu/xml/#view
|
|
|
- */
|
|
|
- viewAttrs?: Record<string, unknown>;
|
|
|
+ children?: React.ReactNode;
|
|
|
/**
|
|
|
* 页面可见状态发生变化回调
|
|
|
*/
|
|
@@ -58,16 +54,6 @@ const DEFAULT_PLUGIN_ATTRS = {
|
|
|
volume: 0,
|
|
|
};
|
|
|
|
|
|
-const DEFAULT_VIEW_ATTRS = {
|
|
|
- hlookat: 0,
|
|
|
- vlookat: 0,
|
|
|
- fovtype: "DFOV",
|
|
|
- fov: 120,
|
|
|
- fovmin: 80,
|
|
|
- fovmax: 130,
|
|
|
- distortion: 0,
|
|
|
-};
|
|
|
-
|
|
|
export const VideoScene: FC<VideoSceneProps> = observer(
|
|
|
({
|
|
|
name,
|
|
@@ -76,7 +62,7 @@ export const VideoScene: FC<VideoSceneProps> = observer(
|
|
|
sourceList,
|
|
|
playRes,
|
|
|
pluginAttrs,
|
|
|
- viewAttrs,
|
|
|
+ children,
|
|
|
onVisibility,
|
|
|
}) => {
|
|
|
const renderer = useContext(KrpanoRendererContext);
|
|
@@ -109,6 +95,7 @@ export const VideoScene: FC<VideoSceneProps> = observer(
|
|
|
};
|
|
|
|
|
|
const wechatJSReadyHandler = () => {
|
|
|
+ alert(model.playing);
|
|
|
model.playing && model.play();
|
|
|
};
|
|
|
|
|
@@ -137,9 +124,6 @@ export const VideoScene: FC<VideoSceneProps> = observer(
|
|
|
pausedonstart: !model.playing,
|
|
|
})
|
|
|
);
|
|
|
- const _viewAttrs = objectToString(
|
|
|
- Object.assign({}, DEFAULT_VIEW_ATTRS, viewAttrs)
|
|
|
- );
|
|
|
|
|
|
renderer.tagAction.pushSyncTag(
|
|
|
"scene",
|
|
@@ -161,9 +145,6 @@ export const VideoScene: FC<VideoSceneProps> = observer(
|
|
|
<sphere url="plugin:video" />
|
|
|
</image>
|
|
|
|
|
|
- <!-- set the default view -->
|
|
|
- <view ${_viewAttrs} />
|
|
|
-
|
|
|
<action name="add_video_sources" >
|
|
|
${getSourceListStr()}
|
|
|
|
|
@@ -173,6 +154,6 @@ export const VideoScene: FC<VideoSceneProps> = observer(
|
|
|
);
|
|
|
}, [renderer]);
|
|
|
|
|
|
- return <div className="video-scene" />;
|
|
|
+ return <div className="video-scene">{children}</div>;
|
|
|
}
|
|
|
);
|