flowplayer

remove FlowPlayer object from html


I use flash player - flowplayer. and after using this player i need to remove it from my page. I use method unload(), but it does nothing. I tried to find question of this problem but find only this. But there are no aswers. Here we see that variable fp is steel exist


Solution

  • From looking at the flowplayer documentation on events for unload it states:

    Unload: Unloads the player Flash component and replaces it with the original HTML content of the container element. This method does nothing if there was no HTML in the container.

    Your example does not work because you have nothing within your container. Typically this is an image (splash screen). The user clicks on the image to start the video, the player is loaded. Unloading the player at the end then removes the player and replaces the image.

    I have created a working demo here.

    Example

    <a href="http://pseudo01.hddn.com/vod/demo.flowplayervod/flowplayer-700.flv" 
       class="player"
       style="display:block;width:425px;height:300px;margin:10px auto"
       id="player">
        <!-- splash image inside the container -->
        <img src="/media/img/home/flow_eye.jpg"
             alt="Search engine friendly content" />
    </a>
    
    $f("player", "http://releases.flowplayer.org/swf/flowplayer-3.2.16.swf", {
        onFinish: function() {            
            this.unload();
        } 
    });