Dynamically setting the source on a CFMEDIAPLAYER tag using JavaScript and ColdFusion

Readability

Dynamically setting the source on a CFMEDIAPLAYER tag using JavaScript and ColdFusion

The fol­low­ing exam­ple shows how you can dynam­i­cally set the source on a <CFME­DI­APLAYER> tag using JavaScript and Cold­Fu­sion by call­ing the ColdFusion.Mediaplayer.setSource() function.

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

The following example shows how you can dynamically set the source on a <CFMEDIAPLAYER> tag using JavaScript and ColdFusion by calling the ColdFusion.Mediaplayer.setSource() function.

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

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

Leave a Reply

Your email address will not be published.