|
@@ -4,12 +4,17 @@ import { useEventCallback } from "../hooks";
|
|
import { IKrpanoConfig, NativeKrpanoRendererObject } from "../types";
|
|
import { IKrpanoConfig, NativeKrpanoRendererObject } from "../types";
|
|
import { useKrpano } from "../hooks/useKrpano";
|
|
import { useKrpano } from "../hooks/useKrpano";
|
|
import { CurrentSceneContext, KrpanoRendererContext } from "../contexts";
|
|
import { CurrentSceneContext, KrpanoRendererContext } from "../contexts";
|
|
|
|
+import { WebVR } from "./WebVR";
|
|
|
|
|
|
export interface KrpanoProps extends Omit<IKrpanoConfig, "onready" | "target"> {
|
|
export interface KrpanoProps extends Omit<IKrpanoConfig, "onready" | "target"> {
|
|
className?: string;
|
|
className?: string;
|
|
children?: React.ReactNode;
|
|
children?: React.ReactNode;
|
|
currentScene?: string;
|
|
currentScene?: string;
|
|
target?: string;
|
|
target?: string;
|
|
|
|
+ /**
|
|
|
|
+ * webvr.xml 地址,需遵循同源策略
|
|
|
|
+ */
|
|
|
|
+ webvrUrl?: string;
|
|
onReady?: (renderer: KrpanoActionProxy) => void;
|
|
onReady?: (renderer: KrpanoActionProxy) => void;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -18,6 +23,7 @@ export const Krpano: React.FC<KrpanoProps> = ({
|
|
children,
|
|
children,
|
|
currentScene,
|
|
currentScene,
|
|
target = "krpano",
|
|
target = "krpano",
|
|
|
|
+ webvrUrl,
|
|
onReady,
|
|
onReady,
|
|
...rest
|
|
...rest
|
|
}) => {
|
|
}) => {
|
|
@@ -56,6 +62,8 @@ export const Krpano: React.FC<KrpanoProps> = ({
|
|
>
|
|
>
|
|
{renderer ? children : null}
|
|
{renderer ? children : null}
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ {webvrUrl && <WebVR url={webvrUrl} />}
|
|
</CurrentSceneContext.Provider>
|
|
</CurrentSceneContext.Provider>
|
|
</KrpanoRendererContext.Provider>
|
|
</KrpanoRendererContext.Provider>
|
|
);
|
|
);
|