You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

zyON

Trainee

  • "zyON" started this thread

Posts: 70

Location: Lisboa, Portugal

  • Send private message

1

Tuesday, August 24th 2010, 8:22pm

Videoplayer as a plugin - hiding and showing video problem

Hi all,

I'm having a weird problem with the Videoplayer plugin:

I'm using it as a plugin, so I can use it on the center of the screen to play some videos that are triggered by some hotspots.

I've created 2 actions to hide/show the video area:

Source code

1
2
3
4
5
6
7
8
9
10
<action name="showVideoPlayer">
		set(plugin[videoplayer].enabled,TRUE);
		set(plugin[videoplayer].alpha,1);
		plugin[videoplayer].playvideo(%1);
</action>
<action name="hideVideoPlayer">
		set(plugin[videoplayer].enabled,FALSE);
		set(plugin[videoplayer].alpha,0);
		plugin[videoplayer].closevideo();
</action>


As you see, I'm using the alpha paramenter to show/hide the video (maybe it's not the best option, any suggestions?) and everything runs well the first time you show and hide the video. The problem is after hiding it, if I try to show it again I get the video area with a frame of the video and a smaller instance running on the top left corner of that window.

Why is that? Anyone with the same problem?

Thanks,
––––•(-• zyON •-)•––––

VN2009

Professional

Posts: 1,336

Location: Duluth MN

  • Send private message

2

Tuesday, August 24th 2010, 9:41pm

instead of using enable and alpha just use visible. by setting something visible false it automatically assumes enabled is false. you will not need the alpha tween unless you like the fade in and out effect.

i had a similar problem to what you are encountering. my solution was to totally remove and recreate the video plugin. instead of jsut closing it i would removeplugin() all together then when click to enable i addplugin() with the needed variables.

zyON

Trainee

  • "zyON" started this thread

Posts: 70

Location: Lisboa, Portugal

  • Send private message

3

Wednesday, August 25th 2010, 12:03pm

VN2009, thanks for the reply,

Yeah, I removing and recreating the plugin seems to me that should be better performance-wise. I'll try that.

I solved the problem by explicitly setting the width and height of the videoplayer plugin in the action that shows it:

Source code

1
2
3
4
5
6
7
<action name="showVideoPlayer">
		set(plugin[videoplayer].enabled,TRUE);
		set(plugin[videoplayer].alpha,1);
		set(plugin[videoplayer].width,640);
		set(plugin[videoplayer].height,480);
		plugin[videoplayer].playvideo(%1);
</action>


but now I'm having sound issues (the sound doesn't restarts)... I'll try the method you indicated to see if all those issues clear out.

Thanks.
––––•(-• zyON •-)•––––