You are not logged in.

1

Tuesday, June 14th 2016, 4:59pm

Dynamic videos + audios url via initvars

Hi,

We wish implement the 360° with dynamic videos + audios url. I can't sadly generate on the fly the xml. I use the initvars in the html page and it works great as I dont have the audio file for iphone.
If I add the audio like below, the url is with both video + audio link > error: loading video failded.

Source code

1
<script>	embedpano({initvars:{		myposter:"http://www.metadelic.com/misc/krpano/examples/360/gotthard_video-1024x512.jpg",		mylowvideo:"http://www.metadelic.com/misc/krpano/examples/360/gotthard_video-1024x512.mp4|http://www.metadelic.com/misc/krpano/examples/360/iphone-audio.m4a", 		myhighvideo:"http://www.metadelic.com/misc/krpano/examples/360/gotthard_video-1024x512.mp4|http://www.metadelic.com/misc/krpano/examples/360/iphone-audio.m4a"	},	swf:"360video.swf", xml:"/misc/krpano/examples/360/360var.xml", target:"pano", html5:"auto", mobilescale:1.0, passQueryParameters:true});</script>



and the call in xml:

Source code

1
<action name="add_video_sources">    	videointerface_addsource('1024x512', '%$mylowvideo%', '%$myposter%');    	videointerface_addsource('2560x1280', '%$myhighvideo%', '%$myposter%');</action>



Can be seen here: http://www.metadelic.com/misc/krpano/360var.html


If I copy the whole links and paster it in xml for test purpose, they works:

Source code

1
<action name="add_video_sources">	videointerface_addsource('1024x512', 'http://www.metadelic.com/misc/krpano/examples/360/gotthard_video-1024x512.mp4|http://www.metadelic.com/misc/krpano/examples/360/iphone-audio.m4a', '%$myposter%');	videointerface_addsource('2560x1280', 'http://www.metadelic.com/misc/krpano/examples/360/gotthard_video-1024x512.mp4|http://www.metadelic.com/misc/krpano/examples/360/iphone-audio.m4a', '%$myposter%');</action>



How can I use the initvars with a pipe in links in html page to handle 2 resolutions + audio for iphone (same track for both resolutions)?
Thank you for your input.

Best regards,
Dom

2

Friday, June 17th 2016, 1:45pm

Any input or someone can point me in the direction I've to look at it?

Thank you. Dom

3

Monday, June 20th 2016, 2:00am

Hello,

I've been trying to do dynamic video/xml pages as well.
In a previous thread a couple pages back:
How to use dynamic video URLs?

It mentions that it breaks when you try to pass through the pipe operator "|"
So to solve it, I leave the pipe inside the xml and split up each file input into it's own initvar to pass.

Ex:
HTML/JS

Source code

1
2
3
4
5
initvars:{
	postername:"gotthard_video-1024x512",
	videoname:"gotthard_video-1024x512",
	audioname: "iphone-audio"
}



XML

Source code

1
videointerface_addsource('1024x512', 'http://www.metadelic.com/misc/krpano/examples/360/%$videoname%.mp4|http://www.metadelic.com/misc/krpano/examples/360/%$videoname%.webm|http://www.metadelic.com/misc/krpano/examples/360/%$audioname%.m4a','http://www.metadelic.com/misc/krpano/examples/360/%$postername%.jpg');


Of course it's up to you how much of the vars you want to pass through (whether to include the whole url or just file name, extension, etc.)
Hope this works for you, too!

4

Monday, June 20th 2016, 8:55am

Hi!

Thx for your reply.

I've tested with a full url initvars and with the pipe in it. Doesnt work.

I will now test with the name + path as they change always, like you explain.
Will come back with the result.

Regards,
Dom

5

Friday, June 24th 2016, 3:29pm

I correct my page: http://www.metadelic.com/misc/krpano/360var1.html

it works well but only if you one resolution, asap you have both resolution, you have to split the url/filename.extension aside the pipe.

Impossible for me to pass the "mp4", as well the "m4a" in a variable in this context, dont know why. So I let it hardcoded as we have only mp4 & m4a for the moment. But will be cool to give the video & audio extension in a variable.
As well I cant give the absolute url for a poster image, iPas generate a parsing error and can't load it. with a relative, no problem.

Thanks a lot for your help. I appreciate.

regards,
dom

This post has been edited 1 times, last edit by "djavet" (Jun 24th 2016, 3:39pm)


6

Wednesday, June 29th 2016, 12:05pm

Hi,

if you don't want to edit the xml, why not directly using the actions via JS?

E.g. call in the onloaded event a JS function and in that JS function call the videointerface_addsource and videointerface_play actions from there...

Btw - great video!

Best regards,
Klaus

7

Wednesday, June 29th 2016, 12:21pm

Thx for your reply.
Good suggestion. I will look at it. For the moment I integrate it with the xml.

Do you have an exemple of this type of integration?

regards,
Dom

8

Tuesday, August 16th 2016, 1:42pm


Hi,

if you don't want to edit the xml, why not directly using the actions via JS?

E.g. call in the onloaded event a JS function and in that JS function call the videointerface_addsource and videointerface_play actions from there...

Btw - great video!

Best regards,
Klaus
I'm trying to call the videointerface_addsource in the onloaded event in JS function as you mentioned, but on I get an error on iPhone. Actually, the error happens when the pausedonstart is set to "true".

Here's what my xml looks like

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<krpano>
    <include url="video-player.xml" />

    <action name="startup" autorun="onstart">

        if(device.panovideosupport == false,
        error('Sorry, but panoramic videos are not supported by your current browser!');
        ,
        loadscene(videopano);
        );
    </action>

    <scene name="videopano" title="">

        <!-- include the videoplayer interface / skin (with VR support) -->
        <include url="skin/videointerface.xml" />

        <!-- include the videoplayer plugin -->
        <plugin name="video"
                url.html5="%SWFPATH%/plugins/videoplayer.js"
                pausedonstart="true"
                loop="true"
                volume="1.0"
                panovideo="false"
                html5preload="auto"
        />

        <!-- use the videoplayer plugin as panoramic image source -->
        <image hfov="360" vfov="180">
            <sphere url="plugin:video" />
        </image>

        <!-- set the default view -->
        <view hlookat="0" vlookat="0" fovtype="DFOV" fov="130" fovmin="75" fovmax="150" distortion="0.0" />
    </scene>

</krpano>


and here's a screenshot of the error displayed

9

Saturday, August 20th 2016, 9:51am

I'm trying to call the videointerface_addsource in the onloaded event in JS function as you mentioned

Post that code too - the error is very probably there.

10

Monday, August 29th 2016, 1:04pm


Post that code too - the error is very probably there.
Here's the code

Source code

1
2
3
4
5
6
embedpano({swf:"vendors/krpano/krpano.swf", xml:"vendors/krpano/krpano.xml", target:"pano", html5:"auto", mobilescale:1.0, passQueryParameters:true, onready:krpanoReady, consolelog:true});

function krpanoReady(krpano) {	
    krpano.call("videointerface_addsource('video', 'assets/video.mp4', 'assets/poster.jpg'");	
    krpano.call("videointerface_play('video', 'true')");
}