This discussion is archived
5 Replies Latest reply: Feb 15, 2013 12:48 PM by TexasApexDeveloper RSS

Playing a Video in Apex

969345 Newbie
Currently Being Moderated
Hi,

I am trying to get a video to display in the database. I tried uploading the video into the Shared Components --> Images, but I cannot get it to display. I know that another option is to store it in a table as a BLOB but I am somewhat new to Apex so I cannot find how to get hte video into the table that I created. I have done multiple searches and cannot seem to find the answer to my question. Can anyone provide some pointers on how to get this to work. I am working in Oracle Database 11g Express.

Thank You,
Tami
  • 1. Re: Playing a Video in Apex
    TexasApexDeveloper Guru
    Currently Being Moderated
    Maybe this older thread will help??: How to post video in Apex4.2?

    Thank you,

    Tony Miller
    Ruckersville, VA
  • 2. Re: Playing a Video in Apex
    Ramesh P, Oracle APEX Developer Journeyer
    Currently Being Moderated
    --Database procedure to get the file
    create or replace PROCEDURE get_video(pfileid IN NUMBER) IS
    v_blob BLOB;
    v_length NUMBER;
    v_mime_type VARCHAR2(300);
    v_file_name VARCHAR2(200);
    BEGIN
    -- get pdf_data and its mime type from the database
    SELECT file_blob, mime_typ, file_nm
    INTO v_blob, v_mime_type, v_file_name
    FROM appl_gui.hcd_cont_dtl_file
    WHERE tablex = pfileid;
    v_length := dbms_lob.getlength(v_blob);
    owa_util.mime_header(v_mime_type, FALSE);
    htp.p('Content-length: ' || v_length);
    htp.p('Content-Disposition: filename="' || v_file_name || '"');
    owa_util.http_header_close;
    wpg_docload.download_file(v_blob);
    EXCEPTION
    WHEN OTHERS THEN
    RAISE_APPLICATION_ERROR(-20001, 'Error: ' || SQLERRM);
    END get_video;


    --Application Process Name it as GET_VIDEO
    BEGIN
    get_pdf(:P25_FILE_ID);
    END;


    BEGIN
              htp.p('
              <object>
              <embed type="application/x-mplayer2" src="f?p=&APP_ID.:25:&APP_SESSION.:APPLICATION_PROCESS=GET_VIDEO::::" name="MediaPlayer" width=800 height=300></embed>
              </object>');
         
    END;
  • 3. Re: Playing a Video in Apex
    sky123 Newbie
    Currently Being Moderated
    Why not just publish the video to Youtube and use something like fancybox (http://fancybox.net/) to open the video in an overlay when the link is clicked? It may not be a good choice to store video content inside database BLOB since it consumes too much database memory and takes too long to download the video. I have one application that simply stores the URL's of the Youtube videos and people click the links and view the video in an overlay box (fancybox).

    Thanks.
    Andy
  • 4. Re: Playing a Video in Apex
    969345 Newbie
    Currently Being Moderated
    This was actually the first thing I tried and I only got a blank white region. I don't know what I might be missing.
  • 5. Re: Playing a Video in Apex
    TexasApexDeveloper Guru
    Currently Being Moderated
    Have you seen this posting?? Play video files

    Thank you,

    Tony Miller
    Ruckersville, VA

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points