Dynamically starting and stopping a video using JavaScript and the CFMEDIAPLAYER tag in ColdFusion

Readability

Dynamically starting and stopping a video using JavaScript and the CFMEDIAPLAYER tag in ColdFusion

The fol­low­ing exam­ple shows how you can dynam­i­cally start and stop a video using JavaScript and the <CFME­DI­APLAYER> tag in Cold­Fu­sion by call­ing the ColdFusion.Mediaplayer.startPlay() and ColdFusion.Mediaplayer.stopPlay() functions.

And the out­put of the <CFME­DI­APLAYER> tag is as fol­lows:

The following example shows how you can dynamically start and stop a video using JavaScript and the <CFMEDIAPLAYER> tag in ColdFusion by calling the ColdFusion.Mediaplayer.startPlay() and ColdFusion.Mediaplayer.stopPlay() functions.

<div style="background-color:#EEEEEE; padding:5px;">
    <input type="button"
            value="startPlay()"
            onclick="ColdFusion.Mediaplayer.startPlay('flvPlayer');" />
    <input type="button"
            value="stopPlay()"
            onclick="ColdFusion.Mediaplayer.stopPlay('flvPlayer');" />
</div>
 
<cfmediaplayer name="flvPlayer"
        source="http://helpexamples.com/flash/video/caption_video.flv"
        autoPlay="true" />

And the output of the <CFMEDIAPLAYER> tag is as follows:

Leave a Reply

Your email address will not be published.