Close button for video

  • 516 / 5000


    http://undefinedhttp://undefinedÜbersetzungsergebnisse


    Hello everyone, I'm still pretty new to coding and have another question. I have a hotspot for which I wrote an action for a video player. so all in all the whole thing works. But now I would like to add a close button if you don't want to see the video all the way to the end that closes the video. Unfortunately I am failing at the moment. I've only been programming with XML for two weeks and hope you can help me a bit further. here is the code as I wrote it:

    <!-- emvideo hotspot -->
    <hotspot name="video1hs"
    url="grafik/video.png"
    alpha="0.9"
    scale="0.25"
    onhover="set(alpha,1); tween(scale,0.35,0.5); showtext([p]emVideo[p])"
    onout="set(alpha,0.9); tween(scale,0.25,0.5);"
    ath="+114.000" atv="9.5"
    onclick="video1()"
    />

    <!-- video1 action -->
    <action name="video1">
    addplugin(v1);
    set(plugin[v1].url,plugins/videoplayer.js);
    set(plugin[v1].videourl,video/bestof.mp4);
    set(plugin[v1].posterurl,skin/icons/postervideo1.png);
    set(plugin[v1].align,center);
    set(plugin[v1].width, 854);
    set(plugin[v1].height, 480);
    set(plugin[v1].loop, false);
    set(plugin[v1].onvideoready, play());
    set(plugin[v1].onvideocomplete, removeplugin(v1)());
    set(plugin[v1].enabled, true);
    set(plugin[v1].visible, true);
    set(plugin[v1].html5controls, true)
    </action>

    Einmal editiert, zuletzt von Wolf73 (10. Dezember 2020 um 20:21)

  • Hi,

    here a quick rebuild of your code.

    Not sure if you use scenes..
    Hotspot in scene

    Code
    <hotspot name="video1hs"
    			url="grafik/video.png"
    			alpha="0.9"
    			scale="0.25"
    			onhover="set(alpha,1); tween(scale,0.35,0.5); showtext([p]emVideo[p])"
    			onout="set(alpha,0.9); tween(scale,0.25,0.5);"
    			ath="+114.000" atv="9.5"
    			onclick="DoVideo(bestof);" 
    		/>

    and some code outside scene (global)

    So we call the DoVideo action and in the brackets we put the video file name like (bestof).
    For the video player we made a style, also for the close button.
    onvideocomplete or on click close button we do: removeplugin(v1,true); that means remove the plugin v1 and it's children.. which is in this case the close button.

    Perhaps it is wise to set the height of the video player to prop. (proportional)..

    You could re-use this action for all flat videos in your 'tour' you like to show like this.
    DoVideo(bloopers); will show your bloopers video then in this manner.


    Hope it's clear and helps,
    Tuur *thumbsup*

Jetzt mitmachen!

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