I'm having issues with getting the view.hlookat from a video SPHERE panorama onviewchanged.
Is there any limitation on this action when it comes to video panoramas/images?
I can get the view.hlookat from a CUBE panorama/image onviewchanged with no issue, leveraging the js function noted below.
Any help would be greatly appreciated.
My XML is:
<krpano version="1.19-pr4">
<plugin name="edittranshub"
url="%SWFPATH%/plugins/videoplayer.swf"
alturl="%SWFPATH%/plugins/videoplayer.js"
videourl="/player/media/00000098566.mp4"
visible="true"
enabled="true"
panovideo="true"
keep="true"
refreshrate="auto"
loop="false"
pausedonstart="true"
/>
<control mousetype="drag2d" mousefriction="0.2" keybspeed="0.1" keybfriction="0.1"/>
<events onviewchanged="transPanoParams()"/>
<action name="transPanoParams">
stopdelayedcall(transPanoParams);
delayedcall(transPanoParams,0.25,
js(setlookat(2));
);
</action>
<view hlookat="0.00" vlookat="0.00" fov="70" fovmin="1" fovmax="170"/>
<image type="SPHERE">
<sphere url="plugin:edittranshub"/>
</image>
</krpano>
And the js function:
function setlookat(pancall) {
if (pancall == 2) {
console.log('2');
krpano2().call("adjusthlookat(0)");
var hlookat2 = Number(krpano2().get("view.hlookat"));
document.getElementById("hlookat_2").value = hlookat2.toFixed(2);
var vlookat2 = Number(krpano2().get("view.vlookat"));
document.getElementById("vlookat_2").value = vlookat2.toFixed(2);
console.log('2 ' + hlookat2 + ' - ' + vlookat2);
}
if (pancall == 1) {
console.log('1');
krpano1().call("adjusthlookat(0)");
var hlookat1 = Number( krpano1().get("view.hlookat") );
document.getElementById("hlookat_1").value = hlookat1.toFixed(2);
var vlookat1 = Number( krpano1().get("view.vlookat") );
document.getElementById("vlookat_1").value = vlookat1.toFixed(2);
console.log('1 ' + hlookat1 + ' - ' + vlookat1);
}
};