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:

    Code
    <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 •-)•––––

  • 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.

  • 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:

    Code
    <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 •-)•––––

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!