I'm building a HTML5 display ad which utilizes 360 video. I have to pass the video URLs dynamically with JavaScript and I can't hard code them into XML. I can't figure out the way to do it. Most of the documentation is centered on configuration via static XML.
How to use dynamic video URLs?
-
-
https://krpano.com/docu/js/#top
It also shows where the javascript examples are in the examples folder.
-
Hi,
and for dynamically playing videos, call the playvideo action:
https://krpano.com/plugins/videoplayer/#actionse.g. (js):
Best regards,
Klaus -
I ended up using a solution that I pass full URLs of webm and mp4 files as initvars. It seems that xml parser can't handle combination of two variable and pipe character. The URLs get joined and only webm format is actually used:
So I decided not to use the pipe character and this solution works:
I would still like to let krpano determine the best format but I also need to use abolute URLs.
OR Should I just give the URLs through JS call and leave the videourl value empty in xml?
-
Hi,and for dynamically playing videos, call the playvideo action:
https://krpano.com/plugins/videoplayer/#actionse.g. (js):
Source code
1
krpano.call("plugin[video].playaction(...);");
Best regards,
KlausSorry but this solution does not work for me, and I'm using your source code example of 1.19 Pre 3 too.
does indeed load the video in my browser's network, however it doesn't actually play.
Now
does play whatever video is loaded into the plugin but this plugin is impossible to set using an onclick inside of my hotspot, so it's really quite useless beyond static videos.
So if the video url is /panorama/1/video-1920x960.mp4 and I try to reset it with a click action on a hotspot
Codekrpano.call("set(hotspot[panoThumbnail].onclick, set( plugin[video].videourl.no-ios,/panorama/69/video-1920x960.mp4|/panorama/69/video-1920x960.webm); plugin[video].play(););");
So it's established that I cannot set the video plugin's url using set() and I and others in my office cannot use playvideo() to actually play a video.
What's the solution
-
Hi,
you should not call/set video.ios but you need to do if(device.ios, plugin[video].playvideo(my_video.mp4));
Hope it helps
Tuur -
Quote
Hi,
you should not call/set video.ios but you need to do if(device.ios, plugin[video].playvideo(my_video.mp4));
Hope it helps
TuurThanks but,
plugin[video].playvideo(my_video.mp4) is not working.
my_video.mp4 will load in my browser's network, but the video will not actually play*confused*
Also doesn't this make video plugins useless beyond static content?
Why would there be an option to set(plugin[]) properties if the most useful and common property of a plugin, videourl cannot be set? -
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!