Skip to main content
Known Participant
January 13, 2011
Question

embedding video in cfm page

  • January 13, 2011
  • 1 reply
  • 1244 views

I am trying to embed a video in a cfm page.  The FORM page before is where they can link the video URL and the preview page is where they can view the video (and other information) before it get submitted and saved in the database.

on the FORM page I have the following code:  (there's much more code, but this is the coding that's related to what I am trying to do.

<cfset #session.video# = #video#>

    <cfif (#video# is "") or (#left (sound, 7)# is not "http://")>

    <cfset #video# = "http://#video#">

  </cfif>

  <input name="video" type="text" size=43 maxlength=250 value="#video#"><br>

Someone types in the url of the video (IE a youtube video or something similar)

ON THE ITEM PREVIEW PAGE. I have the related coding

        <!--- define videoURL --->

    <cfif Left(session.video, 9) IS "http://ww">

      <cfset isVideo = "TRUE">

      <cfset videoURL = Trim(session.video)>

    <cfelse>

      <cfset isVideo = "FALSE">

    </cfif>

<cfif isVideo>
              <cfoutput><br><b>Video:</b><object width="480" height="385"><param name="movie" value="#videoURL#"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="#videoURL#" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></cfoutput>
            </cfif>

Sooo what's suppose to happen is that you see a preview of the video, but nothing shows up

The source code SHOWS the above information with the correct value of the video, but it doesn't show the player, etc.

Not sure what i am doing wrong.

it worked once, but I am not sure what I did or why it's not working now.

    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    January 16, 2011

    What happens when you strip the code down to the bear essentials and do something like

    <cfoutput>
    <object width="480" height="385">
    <param name="movie" value="#videoURL#"></param>
    <param name="allowFullScreen" value="true"></param>
    <param name="allowscriptaccess" value="always"></param>
    <embed src="#videoURL#" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed>
    </object>
    </cfoutput>

    larkinh5Author
    Known Participant
    January 17, 2011

    i did figure it out.  It was a browser compatibility issue.  sortof.. but I got it to work...thanks for your response.