-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
looks good.... comments inline:
Stjepan Rajko wrote:
Hi Michael,
After thinking about the multiple ways in which we want to specify sources to a <video> for mv_embed, I decided to go with some classes that read whatever sources are specified in whatever way, and then provide that information to the rest of mv_embed through a generic interface. I have implemented two classes:
mediaSource represents a single source, and is currently just a <type, uri> tuple mediaElement is a collection of mediaSources, and it knows how to initialize itself from a <video> element (it will read in the <video> src and/or the child <source> elements and/or the <video> roe file). It also guesses MIME types - later we can make it check the file itself.
For example, with the following HTML:
<video roe="http://metavid.ucsc.edu/wiki/index.php?title=Special:MvExportStream&feed... src="http://www.archive.org/download/mv_senate_proceeding_12-23-07/senate_proceed..."
<source src="http://www.archive.org/download/mv_senate_proceeding_12-23-07/senate_proceeding_12-23-07.flv"/> </video>
it will construct the following mediaSources: Adding mediaSource of type video/x-flv and uri http://www.archive.org/download/mv_senate_proceeding_12-23-07/senate_proceed... (from <video>) Adding mediaSource of type video/x-flv and uri http://www.archive.org/download/mv_senate_proceeding_12-23-07/senate_proceed... (from <source>) Adding mediaSource of type video/mp4 and uri http://www.archive.org/download/mv_senate_proceeding_08-01-07/senate_proceed... (from ROE..)
looks good and per html5 spec... ROE request won't necessarily be executed on every display of media. As we discussed on IRC...the html with internal embeds where you don't want the script to hit the roe file will be verbose while external embeds will only have the roe attribute.
Adding mediaSource of type video/mp4 and uri http://www.archive.org/download/mv_senate_proceeding_08-01-07/senate_proceed... Adding mediaSource of type video/mpeg and uri http://www.archive.org/download/mv_senate_proceeding_08-01-07/senate_proceed... Adding mediaSource of type video/mpeg-2 and uri http://www.archive.org/download/mv_senate_proceeding_08-01-07/senate_proceed... Adding mediaSource of type video/x-flv and uri http://www.archive.org/download/mv_senate_proceeding_08-01-07/senate_proceed... Adding mediaSource of type video/ogg and uri http://128.114.20.64/media/senate_proceeding_08-01-07.ogg.anx?t=0:06:00/0:07... Adding mediaSource of type video/ogg and uri http://128.114.20.64/media/senate_proceeding_08-01-07.ogg.anx?t=0:06:00/0:07... Adding mediaSource of type text/cmml and uri http://metavid.ucsc.edu/wiki/index.php?title=Special:MvExportStream&stre... Adding mediaSource of type text/cmml and uri http://metavid.ucsc.edu/wiki/index.php?title=Special:MvExportStream&stre... Adding mediaSource of type text/cmml and uri http://metavid.ucsc.edu/wiki/index.php?title=Special:MvExportStream&stre...
Eventually, the mediaElement will be able to answer queries like "getAllSourcesOfMIMEType(...)", and serve as a proxy to a chosen source (either the default source, or specified source of certain type...). I will get that functionality added as I modify the rest of the code to use mediaElement rather than querying the information directly.
cool this should tie into the plugin capabilities (will have to turn the plugin list into a plugin array). So we can match plugin players to supported MIME types. For example vlc and mplayer support flv video... This gets a bit more complicated once we include client side seeking per player but should be doable.
Also, I started playing with constructing docs. JSDocs seems to work OK: http://urbanstew.org/js_docs_out (or http://www.dancinghacker.com/js_docs_out/ - the other server seems to be down now :-( )
great! documentation ... it does not seem to grab all the methods but maybe that can be fixed somehow:)
One question: I couldn't find where $j.each(...) is coming from (where is it coming from?). It's a cool way of iterating through a node.
that is a jQuery based iterator http://jquery.bassistance.de/api-browser/#eachObjectFunction
It seems to be one of the few good ways for cross browser iterating over xml nodes. There is probably more opportunities to streamline other code with jquery functions. You should take a look at jquery its fun :)
- --michael
On Mon, Jun 2, 2008 at 8:38 PM, Michael Dale dale@ucsc.edu wrote:
Stjepan Rajko wrote:
Eventually, the mediaElement will be able to answer queries like "getAllSourcesOfMIMEType(...)", and serve as a proxy to a chosen source (either the default source, or specified source of certain type...). I will get that functionality added as I modify the rest of the code to use mediaElement rather than querying the information directly.
cool this should tie into the plugin capabilities (will have to turn the plugin list into a plugin array). So we can match plugin players to supported MIME types. For example vlc and mplayer support flv video... This gets a bit more complicated once we include client side seeking per player but should be doable.
Yep - I'm now working on the selection of the stream (some default strategy + the ability for user to change), and am modifying&borrowing the code for the download page. Then I'll tackle the player abstraction.
Also, I started playing with constructing docs. JSDocs seems to work OK: http://urbanstew.org/js_docs_out (or http://www.dancinghacker.com/js_docs_out/ - the other server seems to be down now :-( )
great! documentation ... it does not seem to grab all the methods but maybe that can be fixed somehow:)
It only grabs documented methods / classes - I'll add docs to the existing code as I touch it. With all the verboseness, eventually we should probably provide a minified version of the script.
One question: I couldn't find where $j.each(...) is coming from (where is it coming from?). It's a cool way of iterating through a node.
that is a jQuery based iterator http://jquery.bassistance.de/api-browser/#eachObjectFunction
It seems to be one of the few good ways for cross browser iterating over xml nodes. There is probably more opportunities to streamline other code with jquery functions. You should take a look at jquery its fun :)
fun indeed - thanks for the reference!
Stjepan
On Wed, Jun 4, 2008 at 8:21 PM, Stjepan Rajko stipe@asu.edu wrote:
Yep - I'm now working on the selection of the stream (some default strategy + the ability for user to change), and am modifying&borrowing the code for the download page. Then I'll tackle the player abstraction.
OK, I got a good chunk done on this front now. I consolidated the selectPlaybackMethod + showVideoDownload functions (this was listed as a @todo) and added a showVideoSelection function which is a rip-off of showVideoDownload that allows you to choose a source. The selection code doesn't actually do anything yet (it just js_logs it). You can see the example at:
http://urbanstew.org/MediaWiki/extensions/MetavidWiki/skins/mv_embed/sample_...
The icon below the playback selection icon that looks like the download icon is the stream selection icon :-) I think I can consolidate a little bit more code there and in getThumbnailHTML.
Two questions (for now :-)):
* in ROE you use the title attribute. What should we use for <video> and for <source>? I didn't find anything in the specs. For now, I used the content of the tag (e.g. <source src="...">title here</source>) but that doesn't seem too clean.
* I have a habit of adding accessor functions to classes (e.g., see mediaSource). In JS, this is not necessary - is it useful though? Should I just stop bothering with writing accessor functions?
Some inconsistencies I noticed: HTML5 <video> uses the 'poster' attribute for what MVW uses 'thumbnail'. Also, IIRC, <video> uses 'type' attribute and MVW ROE files use 'content-type'.
great! documentation ... it does not seem to grab all the methods but maybe that can be fixed somehow:)
It only grabs documented methods / classes - I'll add docs to the existing code as I touch it. With all the verboseness, eventually we should probably provide a minified version of the script.
Found another reason why it might not be pulling in all documented methods - my perl chokes on the JSDoc script, so I had to reduce some recursion parameter. That cuts down on what the script can process. I'm now trying to get a newer version of perl to work (that hopefully won't choke on the script).
The temporarily permanent home (while the code is up in the air during the transition) for the docs is now:
http://urbanstew.org/MediaWiki/extensions/MetavidWiki/skins/mv_embed/js_docs...
Best,
Stjepan