You are not logged in.

1

Thursday, August 13th 2015, 8:13am

How to use dynamic video URLs?

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.

Posts: 1,852

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

2

Thursday, August 13th 2015, 6:11pm

http://krpano.com/docu/js/#top

It also shows where the javascript examples are in the examples folder.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

3

Friday, August 14th 2015, 11:58am

Hi,

and for dynamically playing videos, call the playvideo action:
http://krpano.com/plugins/videoplayer/#actions

e.g. (js):

Source code

1
krpano.call("plugin[video].playaction(...);");


Best regards,
Klaus

4

Tuesday, August 18th 2015, 10:44am

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:

Source code

1
videourl="%$videoUrlMp4%|%$videoUrlWebm%"


So I decided not to use the pipe character and this solution works:

Source code

1
2
videourl="%$videoUrlMp4%"
videourl.firefox="%$videoUrlWebm%"


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?

5

Thursday, February 4th 2016, 2:37pm


Hi,

and for dynamically playing videos, call the playvideo action:
http://krpano.com/plugins/videoplayer/#actions

e.g. (js):








Source code




1



krpano.call("plugin[video].playaction(...);");






Best regards,
Klaus
Sorry but this solution does not work for me, and I'm using your source code example of 1.19 Pre 3 too.

Source code

1
krpano.call("plugin[video].playvideo(validvideourl.mp4);");
does indeed load the video in my browser's network, however it doesn't actually play.

Now

Source code

1
krpano.call("plugin[video].play();");
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

Source code

1
krpano.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

Tuur

Sage

Posts: 3,242

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

6

Thursday, February 4th 2016, 2:45pm

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 *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

7

Thursday, February 4th 2016, 3:38pm

Quoted

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 *thumbsup*
Thanks 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?

Tuur

Sage

Posts: 3,242

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

8

Thursday, February 4th 2016, 4:26pm

for me this:

Source code

1
2
3
4
5
6
	function videocall()
	{
		krpano = document.getElementById("krpanoSWFObject");
		krpano.call("plugin[video].playvideo(myvideo.mp4); ");
		
	}


Just works when i call from krpano: js(videocall());

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

Similar threads