Closed
Bug 469923
Opened 16 years ago
Closed 16 years ago
Support X-Content-Duration header
Categories
(Core :: Audio/Video, defect, P2)
Tracking
()
VERIFIED
FIXED
People
(Reporter: cpearce, Assigned: cajbir)
Details
(Keywords: verified1.9.1)
Attachments
(2 files, 3 obsolete files)
20.93 KB,
patch
|
cajbir
:
review+
cajbir
:
superreview+
|
Details | Diff | Splinter Review |
1.47 KB,
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
Web servers will hopefully start sending X-Content-Duration header along with Ogg streams, which denotes the duration of the stream. We should watch out for this and use it in preference to calling oggplay_get_duration() where possible.
Assignee | ||
Comment 1•16 years ago
|
||
Header spec: http://wiki.annodex.net/wiki/HttpHeaders
Assignee | ||
Comment 2•16 years ago
|
||
This patch detects for the presence of X-Content-Duration. If it exists it uses this to set the media duration of an Ogg file and avoids the need to seek to find this out. X-Content-Duration is the 'standard' used by optimized Ogg servers/content management systems that Annodex promotes. oggz-chop will also use this when sending content and this is used by the major Ogg serving sites (Wikimedia, archive.org, Metavid). If X-Content-Duration is not found it looks for x-amz-meta-content-duration. This is for Ogg content hosted on Amazon S3 where all custom headers must be prefixed via x-amz-meta. If neither of these are found it performs a seek via HTTP byte range requests to get the information. I tested this against the following URLS: Does not support any of the headers, falls back to seeking: http://www.double.co.nz/video_test/test5.html Supports X-Content-Duration: http://www.tinyvid.tv/show/t5v1inpguy9t Supports x-amz-meta-content-duration: http://tinyvid.tv/show/207rjoij80r8v The format of X-Content-Duration and x-amz-meta-content-duration is a floating point number containing the duration in seconds.
Assignee: nobody → chris.double
Status: NEW → ASSIGNED
What happens if the value of X-Content-Duration is wrong?
Assignee | ||
Comment 4•16 years ago
|
||
If X-Content-Duration is wrong then wrong values will be passed through. Maybe we could check during playback if we're playing past the current duration point and then change it, sending a durationchanged event. I don't think we use the duration for anywhere other than reporting back to the client so it won't affect the internals of playback.
Comment 5•16 years ago
|
||
Maybe ignore negative values? eg X-Content-Duration: -4.2 or X-Content-Duration: -1
It doesn't really matter what we do with an incorrect value as long as we don't crash, I guess. But we should have a test for it.
Assignee | ||
Updated•16 years ago
|
Flags: blocking1.9.1?
Flags: blocking1.9.1? → blocking1.9.1+
Priority: -- → P2
Assignee | ||
Comment 7•16 years ago
|
||
Checks for negative values and includes tests. The tests need to add headers to the response so I 'inline' the video data to send. Although it's a small video it inlines quite large. Is there a way to load or include other .js files in an .sjs file? I asked on #developers and no one seemed to know. There don't seem to be any examples of doing this anywhere.
Attachment #359028 -
Attachment is obsolete: true
Attachment #360042 -
Flags: superreview?(roc)
Attachment #360042 -
Flags: review?(roc)
Why didn't you use a ^headers^ file? http://mxr.mozilla.org/mozilla-central/find?string=headers + rv = hc->GetResponseHeader(NS_LITERAL_CSTRING("x-content-duration"), contentDurationText); It would be better if this used the preferred capitalization, X-Content-Duration. + rv = hc->GetResponseHeader(NS_LITERAL_CSTRING("x-amz-meta-content-duration"), metaDurationText); Same here. I'd prefer if the code was reorganized so that we only do one ToFloat call, by checking the value of rv and checking for headers until we find one that exists. The code itself looks fine.
Assignee | ||
Comment 9•16 years ago
|
||
> Why didn't you use a ^headers^ file?
Because I didn't know about them? How do they work? Any docs? If someone can point to or describe how to use them I'll change it.
Assignee | ||
Comment 10•16 years ago
|
||
Ok, found some docs here: https://developer.mozilla.org/En/HTTP_server_for_unit_tests Does this mean I still need to have a duplicate copy of the video file in the repository for each of the six tests, since I want to serve the same file with different headers?
Don't know, that would be unfortunate...
Comment 12•16 years ago
|
||
The intent of ^headers^ was to basically provide essentially equivalent functionality to mod_cern_meta: http://httpd.apache.org/docs/2.0/mod/mod_cern_meta.html The intent of it is to provide simple, static header-overriding capability for individual files, not to split headers a number of different ways. Copying the file a bunch of times is probably your best bet, but it's nearly as easy to write one SJS and have it split behavior based on the query string. There isn't a way to load JS files within SJS, at least not in any principled manner; please file a bug on it and we can figure something out.
Comment 13•16 years ago
|
||
Another possibility: does hg support symlinks well enough everywhere to add one copy of the file and make all the others symlinks?
Comment 14•16 years ago
|
||
Or use some Makefile-fu to take a single media file, make copies of it, and generate ^headers^ variations?
Copying the file into multiple locations at build time sounds like the best (simplest) approach. The ^headers^ variations don't need to be dynamically generated.
Assignee | ||
Comment 16•16 years ago
|
||
I like the idea of query parameters to the sjs personally. One file to maintain, no copying. Even better if I can load the binary video file from the sjs and serve that rather than inlining the array. I assume I can do that?
That's good if you can load a binary file, but I don't know if you can. If you can't, inlining the video really sucks :-(
Assignee | ||
Comment 18•16 years ago
|
||
I went the approach of loading the binary file.
Attachment #360042 -
Attachment is obsolete: true
Attachment #360239 -
Flags: superreview?(roc)
Attachment #360239 -
Flags: review?(roc)
Attachment #360042 -
Flags: superreview?(roc)
Attachment #360042 -
Flags: review?(roc)
Attachment #360239 -
Flags: superreview?(roc)
Attachment #360239 -
Flags: superreview+
Attachment #360239 -
Flags: review?(roc)
Attachment #360239 -
Flags: review+
Whiteboard: [needs landing]
Assignee | ||
Comment 19•16 years ago
|
||
Fix bitrot from recent video patch landings. Carried for reviews.
Attachment #360239 -
Attachment is obsolete: true
Attachment #361050 -
Flags: superreview+
Attachment #361050 -
Flags: review+
Assignee | ||
Updated•16 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 20•16 years ago
|
||
Pushed to mozilla-central: http://hg.mozilla.org/mozilla-central/rev/23c281c1130a
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [needs landing] → [baking for 1.9.1]
Assignee | ||
Comment 21•16 years ago
|
||
Attachment #361204 -
Flags: superreview?(roc)
Attachment #361204 -
Flags: review?(roc)
Attachment #361204 -
Flags: superreview?(roc)
Attachment #361204 -
Flags: superreview+
Attachment #361204 -
Flags: review?(roc)
Attachment #361204 -
Flags: review+
Assignee | ||
Comment 22•16 years ago
|
||
Pushed to mozilla-1.9.1: http://hg.mozilla.org/releases/mozilla-1.9.1/rev/003adc9f2896 http://hg.mozilla.org/releases/mozilla-1.9.1/rev/62dd7b299b40
Keywords: fixed1.9.1
Whiteboard: [baking for 1.9.1]
Comment 23•15 years ago
|
||
Chris or Roc, Can i get some help on how to test this fix? i tried installing livehttpheaders addon, and running it against the 3 URLs in comment 2. the results were 1 and 3 did not return any X-Content-duration headers, and only url 2, returned a partial content of "x-amz-meta-content-duration: 313.353" in the header. I tested this on Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090207 Minefield/3.2a1pre (Prior build to trunk checkin), and Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090512 Minefield/3.6a1pre which should have the fix. But it turns out both builds returned the same set of header results i listed above. Shouldnt they differ? Am i testing this incorrectly, or does the fix still need work? Thanks, Tony
Assignee | ||
Comment 24•15 years ago
|
||
The URL's in comment 2 link to the page containing the URL to the video. You should see the headers in these: http://media.tinyvid.tv/207rjoij80r8v.ogg http://tinyvid.tv/file/3uwvr4t3wi3rm.ogg Note that tinyvid will have a different header depending on if it is serving from Amazon S3 or locally. So the headers returned may change in the future. I've locked these files to their current location for a couple of months so these url's are valid for this bug until then. What you should see with these URL's is no http byte range request to find the duration when first loading the file.
Comment 25•15 years ago
|
||
Thanks for the testcases, Chris. Verified http byte range requests duration doesnt generate when videos are loading. Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b5pre) Gecko/20090512 Shiretoko/3.5b5pre and Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090512 Minefield/3.6a1pre
Status: RESOLVED → VERIFIED
Keywords: fixed1.9.1 → verified1.9.1
You need to log in
before you can comment on or make changes to this bug.
Description
•