- From: Kornel Lesinski <kornel@osiolki.net>
- Date: Fri, 23 Mar 2007 20:26:11 -0000
On Fri, 23 Mar 2007 10:24:30 -0000, Silvia Pfeiffer <silviapfeiffer1 at gmail.com> wrote: >> Let's say there's http://example.com/example.html page which contains >> embedded video: >> ...<video src="video.ogg">... >> >> I'd like to be able to construct URL like: >> http://example.com/example.html#@12:35 >> that would cause UA to start playing the embedded video.ogg from 12:35. > > That would be hard, because how would you identify which embedded > video or audio file on the example.html page this temporal offset is > referring to? I think it might work like this: when play() is called on a <video> element, and it hasn't been called on any other video element in this document yet, read time from location.hash and call seek(). This would work with dynamically created <video> elements and would probably be the best choice even if there are multiple <video> elements in the document. If such altered behavior of play() is not unacceptable, then that might work: http://example.com/example.html#myvideo at 12:35 Where "myvideo" part is interpreted as ID of element in the document (and if there's no such element - assume document.body). If the element is a <video>, then seek() that video. If it isn't, then seek first <video> descendant of that element (something like: (document.getElementById("myvideo") || document.body).getElementsByTagName('video')[0].seek(12*60000+35000))). My rationale: * it doesn't require any changes to the document, so user can control starting position in any document, even if author didn't think of such possibility * It's part of document's URL, not URL of the video file, so user doesn't have to extract video file URL from the document and can still use the page (which provides controls for the video). * it can be implemented in JavaScript with current <video> API (also in User JavaScript, but I think for interoperability it's important to be part of the spec). * it's orthogonal to server-side support for seeking > Also, it could be interpreted by the UA only, since > everything after "#" will not be transferred to the server. Yes, that's intentional. It allows user to modify *any* URL without risk of breaking it (some servers/applications may not like extra query string). I think use of hash for this is appropriate - just like UA scrolls HTML to given element, UA would "scroll" the video - it's just a change of axis from Y to time :) -- regards, Kornel Lesi?ski
Received on Friday, 23 March 2007 13:26:11 UTC