You are not logged in.

1

Thursday, March 17th 2016, 11:20am

ERROR 'unknown action: playvideo' on mobile only

Guten Morgen,

I am receiving the error 'WARNING: unknown action: playvideo' on mobile devices only. The desktop plays the video just fine.

The weirdest part about this error is that even when I revert to previous saves where I know 'playvideo' worked, I still receive the error. In fact, this was working yesterday morning when I finished coding and it only began to not work later that night when no code was changed on my end.

the playvideo action is described here: http://krpano.com/plugins/videoplayer/#playvideo


and here is where I call it, where the error is thrown.

<hotspot name="featured_panorama"
distorted="true"
url="http://beta.vr.meventi.de/panorama/78/featured_thumb.png"
ty="375" tx="-860"
rx="0.0" ry="-15.0" rz="0.0"
scale="1.08"
depth="1300"
onover="tween(depth,1260);" onout="tween(depth,1300);"
onclick="changepano( loadscene(video_scene, null, MERGE|KEEPVIEW|KEEPMOVING, BLEND(1)); ); ifnot(device.ios, set(plugin[video].videourl, /panorama/78/video-1920x960.mp4); , set(plugin[video].videourl, /panorama/78/video-1344x672.mp4|/panorama/78/video-iphone-sound.mp3);); ifnot(device.ios, plugin[video].playvideo(/panorama/78/video-1920x960.mp4); , playvideo(/panorama/78/video-1344x672.mp4|/panorama/78/video-iphone-sound.mp3);); plugin[video].play(); hide_all_videos();"
/>


<plugin name="video" keep="true"
url.flash="%SWFPATH%/plugins/videoplayer.swf"
url.html5="%SWFPATH%/plugins/videoplayer.js"
videourl.no-ios="/panorama/%$panoId%/video-1920x960.mp4|/panorama/%$panoId%/video-1920x960.webm"
videourl.ios="/panorama/%$panoId%/video-1344x672.mp4|/panorama/%$panoId%/video-iphone-sound.mp3"
loop="true"
pausedonstart="true"
visible="false"
use_as_videopano="true"
/>

Note that plugin[video].play(); does work on mobile devices


*smile* Ian,

Using 1.19 pr3

This post has been edited 1 times, last edit by "inframatic" (Mar 17th 2016, 12:23pm)


2

Thursday, March 17th 2016, 12:24pm

I would even be open to finding a different method to set the video and play it.

Right now though, I'm having a small heart attack because my panos aren't working :(

Tuur

Sage

Posts: 3,839

Location: Netherlands

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

  • Send private message

3

Thursday, March 17th 2016, 1:01pm

Pm send!

playvideo should be plugin[video].playvideo...
But there is a betterway of doing these things.
;-)
Tuur *thumbsup*

Tuur

Sage

Posts: 3,839

Location: Netherlands

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

  • Send private message

4

Thursday, March 17th 2016, 2:05pm

Consider this:

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
38
39
40
41
42
43
44
45
46
47
48
<action name="startup">
	loadscene(scene_1,null,MERGE,BLEND(0.5));
</action>


		<plugin name="video" preload="true"
	        url.flash="plugins/videoplayer.swf"
	        url.html5="plugins/videoplayer.js"
		keep="true"
	        pausedonstart="false"
		autoresume="true"
	        loop="true"
	        enabled="false"
	        zorder="0"
	        align="center" ox="0" oy="0"
	        width.no-panovideosupport="100%"
	        height.no-panovideosupport="prop"
		use_as_videopano="true"
	        onloaded=""
	        onvideoready=""
		onvideocomplete=""
	        />



<action name="ChangeVideoScene" > 
	if(device.desktop,
		plugin[video].playvideo(video/%1-2k.mp4|video/%1-2k.webm);
	);	
</action>	



<scene name="scene_1" title="normalscene" onstart="plugin[video].stop();" >
	<preview type="grid(cube,16,16,512,0xCCCCCC,0x666666,0x999999);" details="16" />
	<view hlookat="0" />

	<hotspot name="htsp_1"  url="textfield.swf" distorted="true" width="60" height="60" ath="20" atv="-5"  backgroundcolor="0xffffff" onclick="loadscene(scene_2,null,MERGE, BLEND(1));" /> 	
</scene>  


<scene name="scene_2" title="videoscene" onstart="ChangeVideoScene(heli);" >
    <view hlookat="0" vlookat="0" fov="90" fovmin="70" fovmax="120" limitview="on" />
        <image>
            <sphere url="plugin:video" />
        </image>
    <hotspot name="htsp_1"  url="textfield.swf" distorted="true" width="60" height="60" ath="20" atv="-5" backgroundcolor="0xff0000" onclick="loadscene(scene_1,null,MERGE, BLEND(1));" /> 	
</scene>


in my video folder i have the following files in this example case.
heli-2k.mp4
heli-2k.webm


of course you can extend the ChangevideoScene action for the different devices and resolutions etc..
Very convenient this way. And also easy to make multi 360 video tours or mixed content etc.. With using the moving hotspots of course ;-)

Hope it helps,

Tuur *thumbsup*

5

Thursday, March 17th 2016, 4:47pm

You fixed the problem and optimised my code!

The actual error was immediately fixed when i added plugin[video].playvideo() instead of playvideo.
I am baffled as to how this worked for so long before but then suddenly stopped working.

Why do you set the plugin's enabled to equal false? Doesn't the plugin basically not do anything if I'm on a different scene?


The ChangeVideoScene() and startup() shortened my code by a good chunk since I was repeating this hotspot example above in a number of places.


Thanks again!


Ian Steffy *tongue*