Highlighted

Are We Using Cfmediaplayer Correctly?

Community Beginner ,
Dec 23, 2014

Copy link to clipboard

Copied

Hello,

We came across a code example from Ben Forta's blog demonstrating how the CFMEDIAPLAYER works. We are trying to use his example and customize it for our site. The example doesn't seem to work for us. All we are getting is the black, empty video screen. Could we get your opinions on the code below? We appreciate your help in advance. Thanks.

Best regards,

Chung Lee

P.S. We're on CF10.

--------------------------------------------------------

<cfoutput>

<cfset q = queryNew("title,description,url")>

<cfset queryAddRow(q)>

<cfset querySetCell(q, "title", "Video One")>

<cfset querySetCell(q, "description", "Video One Is About.")>

<cfset querySetCell(q, "url", "/Video/upload/video_one.flv")>

<cfset queryAddRow(q)>

<cfset querySetCell(q, "title", "Video Two")>

<cfset querySetCell(q, "description", "Video Two Is About.")>

<cfset querySetCell(q, "url", "/Video/upload/video_two.flv")>

<cfset queryAddRow(q)>

<cfset querySetCell(q, "title", "Video Three")>

<cfset querySetCell(q, "description", "Video Three Is About.")>

<cfset querySetCell(q, "url", "/Video/upload/video_three.flv")>

<cfajaxproxy bind="javascript:gridChange({mediafiles.url})">

<html>

<head>

<script>

function gridChange(url) {

ColdFusion.Mediaplayer.setSource("mediaplayer", url)

}

</script>

</head>

<body>

<h2>Click to View</h2>

<cfform name="boguswhydoineedaformforthis">

<cfgrid name="mediafiles" format="html" query="q" selectonload="false">

<cfgridcolumn name="title" header="Title">

<cfgridcolumn name="description" header="Description">

<cfgridcolumn name="url" display="false">

</cfgrid>

</cfform>

<cfmediaplayer name="mediaplayer" source="#q.url#" autoplay="yes">

</body>

</html>

</cfoutput>

Views

85

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Are We Using Cfmediaplayer Correctly?

Community Beginner ,
Dec 23, 2014

Copy link to clipboard

Copied

Hello,

We came across a code example from Ben Forta's blog demonstrating how the CFMEDIAPLAYER works. We are trying to use his example and customize it for our site. The example doesn't seem to work for us. All we are getting is the black, empty video screen. Could we get your opinions on the code below? We appreciate your help in advance. Thanks.

Best regards,

Chung Lee

P.S. We're on CF10.

--------------------------------------------------------

<cfoutput>

<cfset q = queryNew("title,description,url")>

<cfset queryAddRow(q)>

<cfset querySetCell(q, "title", "Video One")>

<cfset querySetCell(q, "description", "Video One Is About.")>

<cfset querySetCell(q, "url", "/Video/upload/video_one.flv")>

<cfset queryAddRow(q)>

<cfset querySetCell(q, "title", "Video Two")>

<cfset querySetCell(q, "description", "Video Two Is About.")>

<cfset querySetCell(q, "url", "/Video/upload/video_two.flv")>

<cfset queryAddRow(q)>

<cfset querySetCell(q, "title", "Video Three")>

<cfset querySetCell(q, "description", "Video Three Is About.")>

<cfset querySetCell(q, "url", "/Video/upload/video_three.flv")>

<cfajaxproxy bind="javascript:gridChange({mediafiles.url})">

<html>

<head>

<script>

function gridChange(url) {

ColdFusion.Mediaplayer.setSource("mediaplayer", url)

}

</script>

</head>

<body>

<h2>Click to View</h2>

<cfform name="boguswhydoineedaformforthis">

<cfgrid name="mediafiles" format="html" query="q" selectonload="false">

<cfgridcolumn name="title" header="Title">

<cfgridcolumn name="description" header="Description">

<cfgridcolumn name="url" display="false">

</cfgrid>

</cfform>

<cfmediaplayer name="mediaplayer" source="#q.url#" autoplay="yes">

</body>

</html>

</cfoutput>

Views

86

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Dec 23, 2014 0

Have something to add?

Join the conversation