Hello everybody !
I need help getting the "skip/range" functionnality to my embedded Audio/Video player in Apex.
The file is stocked in custum tables including a BLOB column.
The problem is that most of the time I click to skip in a place in the audio/video, it starts at the beginning or continue where it was. How do I allow the "Skip/Range" feature to work correctly all the time for theses files ?
Here is how it is set-up :
1 - An "Application Process" is defined in an application. It reads two "Application Items" for the document ID and the "Inline" attribute.
--> The application process is used for security instead of putting the procedure public.
--> My URL looks like this : http://abc.def.com/apex/f?p=1234:0:sessionId:APPLICATION_PROCESS=GET_DOCMN_FILE:NO::A_DOWNL_DOCMN_FILE_NUM,A_DOWNL_INLINE:documentID,NO
--> The URL is used in a standard HTML5 video tag with MediaElement.js on top of it.
2 - The Process call the download procedure that looks like this :
procedure downl_docmn_file (
pnu_docmn_file_num in vd_i_tc_docmn_file.docmn_file_num%type
,pbl_inline in boolean default true)
is
vst_docmn_file st_docmn_file;
begin
vst_docmn_file := get_docmn_file (pnu_docmn_file_num);
wwv_flow_file_mgr.download_file (
p_file_content => vst_docmn_file.file_contn
,p_file_name => vst_docmn_file.file_name
,p_mime_type => vst_docmn_file.mime_type
,p_file_charset => vst_docmn_file.charset
,p_last_updated_on => nvl (vst_docmn_file.modfc_date
,vst_docmn_file.creat_date)
,p_etag => to_char (vst_docmn_file.docmn_file_num)
|| to_char (
nvl (vst_docmn_file.modfc_date
,vst_docmn_file.creat_date)
,'JHH24MISS')
,p_is_attachment => not pbl_inline);
end downl_docmn_file;
3 - Here is what my first request header looks like :
Accept-Encoding: identity;q=1, *;q=0
Range: bytes=0-
Referer: http://abc.def.com/apex/f?p=1000:1001:sessionId::No::
4 - And the response header looks like this for the first play.
Status Code:200 OK
Cache-Control:must-revalidate, max-age=0
Content-Disposition:attachment; filename="filename.mp4"; filename*=UTF-8''filename.mp4
Content-Language:en
Content-Length:6254236
Content-Range:bytes 0-6254235/6254236
Content-Type:video/mp4
Date:Thu, 06 Aug 2015 15:53:59 GMT
Etag:"127972457112011222"
Last-Modified:Mon, 30 Mar 2015 05:12:22 GMT
Server:Oracle-Application-Server-11g
X-DB-Content-length:0
X-ORACLE-DMS-ECID:0057AQ73mHr5qY^5xVp2iW00016b001Ufq
X-Powered-By:Servlet/2.5 JSP/2.1
5 - If I try to Skip the video, the Request Header looks like this (Notice the Range):
Accept:*/*
Accept-Encoding:identity;q=1, *;q=0
Accept-Language:fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4
Connection:keep-alive
Host:abc.def.com
If-Modified-Since:Mon, 30 Mar 2015 05:12:22 GMT
If-None-Match:"127972457112011222"
Range:bytes=20872-6254235
Referer:http://abc.def.com/apex/f?p=1000:1001:sessionId::No::
User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.125 Safari/537.36
6 - And the Response header look like this :
Status Code:304 Not Modified
Connection:Keep-Alive
Date:Thu, 06 Aug 2015 19:38:52 GMT
Keep-Alive:timeout=5, max=100
Server:Oracle-Application-Server-11g
X-DB-Content-length:0
X-ORACLE-DMS-ECID:0057AafKJp05qY^5xVp2iW00016b001cYQ
X-Powered-By:Servlet/2.5 JSP/2.1
Note : It sometimes worked correctly (When the page had been open for a long long time) and sometimes received à 206 (Partial Data (From Cache).
Thanks for helping me
Guillaume