r61211 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61210‎ | r61211 | r61212 >
Date:19:57, 18 January 2010
Author:dale
Status:deferred (Comments)
Tags:
Comment:
* followup to r61202 restoring upload support
* some sequence updates
** added playlistEmbed stubs ( for new playlist player system )
* skin updates
* added application/ogg support to players
Modified paths:
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.RemoteSearchDriver.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/nativeEmbed.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/loader.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.PlayList.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/playListEmbed.js (deleted) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/playlistEmbed.js (added) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/mwEmbed.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/skins/mvpcf/styles.css (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/tests/Playlist_Render.html (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/tests/Sequence_Editor.html (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/tests/media/kenburns_smil.xml (added) (history)
  • /branches/js2-work/phase3/js/mwEmbed/tests/media/sample_smil.xml (deleted) (history)
  • /branches/js2-work/phase3/js/mwEmbed/tests/media/sequence_transition_smil.xml (added) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/tests/media/sample_smil.xml
@@ -1,47 +0,0 @@
2 -<smil xmlns="http://www.w3.org/2001/SMIL20/Language">
3 - <head>
4 - <meta name="title" content="Simple Crossfading Example"/>
5 -
6 - <transition id="fromGreen"
7 - type="fade"
8 - subtype="fadeFromColor"
9 - fadeColor="#87CF87"
10 - dur="4s"/>
11 -
12 - <transition id="toGreen"
13 - type="fade"
14 - subtype="fadeToColor"
15 - fadeColor="#87CF87"
16 - dur="4s"/>
17 -
18 - <transition id="xFade"
19 - type="fade"
20 - subtype="crossfade"
21 - dur="4s"/>
22 -
23 - </head>
24 - <body>
25 - <seq>
26 -
27 - <video src="http://upload.wikimedia.org/wikipedia/commons/d/d3/Okapia_johnstoni5.ogg"
28 - region="video_region"
29 - transIn="fromGreen"
30 - transOut="xFade"
31 - type="video/ogg"
32 - fill="transition"
33 - durationHint="15"
34 - dur="7s"
35 - poster="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Okapia_johnstoni5.ogg/mid-Okapia_johnstoni5.ogg.jpg"/>
36 -
37 - <video src="http://upload.wikimedia.org/wikipedia/commons/0/0d/B-36_bomber.ogg"
38 - region="video_region"
39 - fill="transition"
40 - dur="10s"
41 - durationHint="70"
42 - type="video/ogg"
43 - poster="http://upload.wikimedia.org/wikipedia/commons/thumb/0/0d/B-36_bomber.ogg/mid-B-36_bomber.ogg.jpg"/>
44 - </seq>
45 - </body>
46 -</smil>
47 -
48 -
Index: branches/js2-work/phase3/js/mwEmbed/tests/media/sequence_transition_smil.xml
@@ -0,0 +1,51 @@
 2+<?xml version="1.0" encoding="UTF-8"?>
 3+<smil baseProfile="Language" version="3.0" xmlns="http://www.w3.org/ns/SMIL">
 4+ <head>
 5+ <meta name="title" content="Simple Crossfading Example"/>
 6+
 7+ <transition id="fromGreen"
 8+ type="fade"
 9+ subtype="fadeFromColor"
 10+ fadeColor="#87CF87"
 11+ dur="4s"/>
 12+
 13+ <transition id="toGreen"
 14+ type="fade"
 15+ subtype="fadeToColor"
 16+ fadeColor="#87CF87"
 17+ dur="4s"/>
 18+
 19+ <transition id="xFade"
 20+ type="fade"
 21+ subtype="crossfade"
 22+ dur="4s"/>
 23+
 24+ </head>
 25+ <body>
 26+ <seq>
 27+
 28+ <video src="http://upload.wikimedia.org/wikipedia/commons/d/d3/Okapia_johnstoni5.ogg"
 29+ region="video_region"
 30+ transIn="fromGreen"
 31+ transOut="xFade"
 32+ type="video/ogg"
 33+ fill="transition"
 34+ durationHint="15"
 35+ dur="9s"
 36+ poster="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Okapia_johnstoni5.ogg/mid-Okapia_johnstoni5.ogg.jpg"
 37+ />
 38+
 39+ <video src="http://upload.wikimedia.org/wikipedia/commons/0/0d/B-36_bomber.ogg"
 40+ region="video_region"
 41+ fill="transition"
 42+ dur="10s"
 43+ durationHint="70"
 44+ type="video/ogg"
 45+ poster="http://upload.wikimedia.org/wikipedia/commons/thumb/0/0d/B-36_bomber.ogg/mid-B-36_bomber.ogg.jpg"
 46+ />
 47+ </seq>
 48+
 49+ </body>
 50+</smil>
 51+
 52+
Property changes on: branches/js2-work/phase3/js/mwEmbed/tests/media/sequence_transition_smil.xml
___________________________________________________________________
Name: svn:mergeinfo
153 + /branches/REL1_15/phase3/js2/mwEmbed/example_usage/media/sample_smil.xml:51646
/branches/sqlite/js2/mwEmbed/example_usage/media/sample_smil.xml:58211-58321
Name: svn:eol-style
254 + native
Index: branches/js2-work/phase3/js/mwEmbed/tests/media/kenburns_smil.xml
@@ -0,0 +1,51 @@
 2+<?xml version="1.0" encoding="UTF-8"?>
 3+<smil baseProfile="Language" version="3.0" xmlns="http://www.w3.org/ns/SMIL">
 4+ <head>
 5+ <meta name="title" content="Simple "Ken Burns" Example"/>
 6+
 7+ <transition id="xFade"
 8+ type="fade"
 9+ subtype="crossfade"
 10+ dur="4s"/>
 11+
 12+ <layout>
 13+ <root-layout height="320" width="240" backgroundColor="red" />
 14+ <region xml:id="B" top="0" left="0" height="320" width="240" backgroundColor="blue" />
 15+ </layout>
 16+
 17+ </head>
 18+ <body>
 19+ <seq>
 20+ <!-- source img is 437x599 !-->
 21+ <img
 22+ src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/79/JackDelanolocomotiveshop.jpg/437px-JackDelanolocomotiveshop.jpg"
 23+ panZoom="0,0,90%,50%"
 24+ dur="10s"
 25+ region="B"
 26+ fit="meet"
 27+ fill="transition"
 28+ >
 29+ <--! scroll down and zoom in on the image !-->
 30+ <animate attributeName="panZoom"
 31+ values="5%,0,90%,50%; 0,50%,100%,50%"
 32+ dur="10s" />
 33+ </img>
 34+ <img
 35+ src="http://upload.wikimedia.org/wikipedia/commons/thumb/5/5f/T%C3%BCrkenbund_Lilie%2C_Lilium_martagon.JPG/415px-T%C3%BCrkenbund_Lilie%2C_Lilium_martagon.JPG"
 36+ panZoom="0,0,100,75"
 37+ transIn="xFade"
 38+ dur="10s"
 39+ region="B"
 40+ fit="meet"
 41+ >
 42+ <animate attributeName="panZoom"
 43+ values="25,20,50,75; 45,55,50,75; 140,40,50,75; 35,0,100,150; 0,0,100,150"
 44+ dur="20s" />
 45+ </img>
 46+
 47+ </seq>
 48+
 49+ </body>
 50+</smil>
 51+
 52+
Index: branches/js2-work/phase3/js/mwEmbed/tests/Sequence_Editor.html
@@ -8,7 +8,7 @@
99 mw.ready(function(){
1010 mw.load( 'Sequencer', function(){
1111 $j('#seqcontainer').sequencer({
12 - 'mv_pl_src':'media/sample_smil.xml',
 12+ 'mv_pl_src':'media/sequence_transition_smil.xml',
1313 //set the add media wizard to only include commons:
1414 'amw_conf':{
1515 'enabled_providers':['wiki_commons']
Index: branches/js2-work/phase3/js/mwEmbed/tests/Playlist_Render.html
@@ -41,9 +41,13 @@
4242 </script>
4343 </head>
4444 <body>
45 - <playlist id="render_player" src="media/sample_smil.xml" controls="false" width="320" height="240"></playlist>
 45+ <playlist id="render_player"
 46+ src="media/sequence_transition_smil.xml"
 47+ controls="false"
 48+ width="320"
 49+ height="240">
 50+ </playlist>
4651
47 -
4852 <!--<video id="render_player"
4953 durationHint="5"
5054 src="http://upload.wikimedia.org/wikipedia/commons/4/41/Panthera_tigris8.ogg"
@@ -62,6 +66,7 @@
6367 <button id="buttonStop">Stop</button>
6468 Current Time: <input type="text" id="time_status" value="0.0" />
6569 <span id="status"></span><br>
 70+ <button id="buttonSeek3">Seek to 3 seconds</button>
6671 </div>
6772
6873 </body>
Index: branches/js2-work/phase3/js/mwEmbed/skins/mvpcf/styles.css
@@ -494,7 +494,6 @@
495495 }
496496
497497 .ui-widget-content input {
498 - width: 450px;
499498 padding: 5px;
500499 }
501500
@@ -513,6 +512,8 @@
514513 margin: 0 0.5em 0 -0.5em;
515514 padding: 0 0.5em;
516515 color: blue;
 516+ list-style-image:none;
 517+ cursor:pointer;
517518 }
518519
519520 ul.ui-provider-selection li .ui-selected {
@@ -527,7 +528,7 @@
528529
529530 ul.ui-provider-selection li a {
530531 color: blue;
531 - text-decoration: none;
 532+ text-decoration: none;
532533 }
533534
534535 /* Vertical Tabs
@@ -591,8 +592,7 @@
592593
593594 .related_vids ul {
594595 margin:0;
595 - padding:0;
596 -
 596+ padding:0;
597597 list-style-image:none;
598598 list-style-position:inside;
599599 list-style-type:none;
@@ -600,7 +600,6 @@
601601 padding:0;
602602 }
603603
604 -
605604 .related_vids li{
606605 -x-system-font:none;
607606 color:#FAFAFA;
Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js
@@ -1,4 +1,4 @@
2 -/*
 2+/**
33 * The Core timed Text interface object
44 *
55 * handles class mappings for:
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.RemoteSearchDriver.js
@@ -53,7 +53,7 @@
5454 "mwe-ftype-oga" : "Ogg audio file",
5555 "mwe-ftype-ogg" : "Ogg video file",
5656 "mwe-ftype-unk" : "Unknown file format",
57 -
 57+
5858 "rsd-wiki_commons-title": "Wikimedia Commons",
5959 "rsd-wiki_commons": "Wikimedia Commons, an archive of freely-licensed educational media content (images, sound and video clips)",
6060
@@ -202,9 +202,7 @@
203203 /**
204204 * Content_providers documentation
205205 *
206 - * @enabled: whether the search provider can be selected
207 - *
208 - * @checked: whether the search provider will show up as selectable tab
 206+ * @enabled: whether the search provider can be selected
209207 *
210208 * @default: default: if the current cp should be displayed (only one should be the default)
211209 *
@@ -240,8 +238,7 @@
241239 * Local wiki search
242240 */
243241 'this_wiki': {
244 - 'enabled': 1,
245 - 'checked': 1,
 242+ 'enabled': 1,
246243 'api_url': ( wgServer && wgScriptPath ) ?
247244 wgServer + wgScriptPath + '/api.php' : null,
248245 'lib': 'mediaWiki',
@@ -254,7 +251,6 @@
255252 */
256253 'kaltura': {
257254 'enabled': 1,
258 - 'checked': 1,
259255 'homepage': 'http://kaltura.com',
260256 'api_url': 'http://kaldev.kaltura.com/michael/aggregator.php',
261257 'lib': 'kaltura',
@@ -267,7 +263,6 @@
268264 */
269265 'wiki_commons': {
270266 'enabled': 1,
271 - 'checked': 1,
272267 'homepage': 'http://commons.wikimedia.org/wiki/Main_Page',
273268 'api_url': 'http://commons.wikimedia.org/w/api.php',
274269 'lib': 'mediaWiki',
@@ -277,7 +272,7 @@
278273 // Commons can be enabled as a remote repo do check shared
279274 'check_shared': true,
280275
281 - // List all the domains where commons is local:
 276+ // List all the domains where commons is local ( lets you avoid an api check for "shared" repo )
282277 'local_domains': [ 'wikimedia', 'wikipedia', 'wikibooks' ],
283278
284279 // Specific to wiki commons config:
@@ -290,7 +285,6 @@
291286 */
292287 'archive_org': {
293288 'enabled': 1,
294 - 'checked': 1,
295289 'homepage': 'http://www.archive.org/about/about.php',
296290
297291 'api_url': 'http://www.archive.org/advancedsearch.php',
@@ -305,7 +299,6 @@
306300 */
307301 'flickr': {
308302 'enabled': 1,
309 - 'checked': 1,
310303 'homepage': 'http://www.flickr.com/about/',
311304
312305 'api_url': 'http://www.flickr.com/services/rest/',
@@ -321,7 +314,6 @@
322315 */
323316 'metavid': {
324317 'enabled': 1,
325 - 'checked': 1,
326318 'homepage': 'http://metavid.org/wiki/Metavid_Overview',
327319 'api_url': 'http://metavid.org/w/index.php?title=Special:MvExportSearch',
328320 'lib': 'metavid',
@@ -349,8 +341,7 @@
350342 * Special Upload tab provider
351343 */
352344 'upload': {
353 - 'enabled': 1,
354 - 'checked': 1,
 345+ 'enabled': 1,
355346 'title': 'Upload'
356347 }
357348 },
@@ -485,7 +476,7 @@
486477 // Set up the local API upload URL
487478 if ( _this.upload_api_target == 'local' ) {
488479 if ( ! _this.local_wiki_api_url ) {
489 - $j( '#tab-upload' ).html( gM( 'rsd_config_error', 'missing_local_api_url' ) );
 480+ $j( '#rsd_results_container' ).html( gM( 'rsd_config_error', 'missing_local_api_url' ) );
490481 return false;
491482 } else {
492483 _this.upload_api_target = _this.local_wiki_api_url;
@@ -862,7 +853,7 @@
863854 for ( var providerName in this.content_providers ) {
864855 var content_providers = this.content_providers;
865856 var provider = content_providers[ providerName ];
866 - if ( provider.enabled && provider.checked && provider.api_url ) {
 857+ if ( provider.enabled && provider.api_url ) {
867858 var $anchor = $j( '<div />' )
868859 .text( gM( 'rsd-' + providerName + '-title' ) )
869860 .attr({
@@ -877,6 +868,8 @@
878869 .removeClass( 'ui-selected' );
879870 $j( this ).addClass( 'ui-selected' );
880871 _this.current_provider = $j( this ).attr( "name" );
 872+ // Update the search results on provider selection
 873+ _this.showSearchTab( _this.current_provider, true );
881874 });
882875
883876 var $listItem = $j( '<li />' );
@@ -907,17 +900,24 @@
908901
909902 $searchForm.append( $providerSelection );
910903 $searchForm.append( $searchBox );
911 - $searchForm.append( $searchButton );
912 - /*
 904+ $searchForm.append( $searchButton );
913905 // Add optional upload buttons.
914906 if ( this.content_providers['upload'].enabled) {
915 - $uploadButton = $j.button({icon_id: 'upload', text: 'upload'})
916 - .addClass("rsd_upload_button");
 907+ $uploadButton = $j.button( { icon_id: 'disk', text: gM( 'mwe-upload_tab' ) })
 908+ .addClass("rsd_upload_button")
 909+ .click(function(){
 910+ _this.current_provider = 'upload';
 911+ _this.showUploadTab( );
 912+ });
 913+ $searchForm.append( $uploadButton );
 914+ /*
 915+ // Import functionality not yet supported
917916 $importButton = $j.button({icon_id: 'import', text: 'import'})
918917 .addClass("rsd_import_button");
919 - $searchForm.append( $uploadButton ).append( $importButton );
 918+ .append( $importButton );
 919+ */
920920 }
921 - */
 921+
922922 $controlContainer.append( $searchForm );
923923
924924 return $controlContainer;
@@ -930,42 +930,17 @@
931931 mw.log( "showUploadTab::" );
932932 var _this = this;
933933 // set it to loading:
934 - $j( '#tab-upload' ).loadingSpinner();
935 - // Do things async to keep interface snappy
936 - setTimeout(
937 - function() {
938 - // check if we need to setup the proxy::
939 - if ( _this.upload_api_target == 'proxy' ) {
940 - _this.setupProxy( function() {
941 - _this.showUploadForm();
942 - } );
943 - } else {
944 - _this.showUploadForm();
945 - }
946 - },
947 - 1 );
948 - },
949 -
950 - /**
951 - * Shows the upload from
952 - */
953 - showUploadForm: function() {
954 - var _this = this;
 934+ $j( '#rsd_results_container' ).loadingSpinner();
 935+ //Show the upload form
955936 mw.load( ['$j.fn.simpleUploadForm'], function() {
956937 var provider = _this.content_providers['this_wiki'];
957938
958 - // check for "this_wiki" enabled
959 - /*if(!provider.enabled){
960 - $j('#tab-upload')
961 - .html('error this_wiki not enabled (can\'t get uploaded file info)');
962 - return false;
963 - }*/
964 -
965939 // Load this_wiki search system to grab the resource
966940 _this.loadSearchLib( provider, function() {
967 - _this.showUploadForm_internal( provider );
 941+ _this.showUploadForm( provider );
968942 } );
969943 } );
 944+
970945 },
971946
972947 /**
@@ -973,39 +948,49 @@
974949 *
975950 * @param {Object} provider Provider object for Upload From
976951 */
977 - showUploadForm_internal: function( provider ) {
 952+ showUploadForm: function( provider ) {
978953 var _this = this;
979954 var uploadMsg = gM( 'mwe-upload_a_file', _this.upload_api_name );
980955 var recentUploadsMsg = gM( 'mwe-your_recent_uploads', _this.upload_api_name );
981956
982957 // Do basic layout form on left upload "bin" on right
983 - $j( '#tab-upload' ).html(
984 - '<table>' +
985 - '<tr>' +
986 - '<td valign="top" style="width:350px; padding-right: 12px;">' +
987 - '<h4>' + uploadMsg + '</h4>' +
988 - '<div id="upload_form">' +
989 - mw.loading_spinner() +
990 - '</div>' +
991 - '</td>' +
992 - '<td valign="top" id="upload_bin_cnt">' +
993 - '<h4>' + recentUploadsMsg + '</h4>' +
994 - '<div id="upload_bin">' +
995 - mw.loading_spinner() +
996 - '</div>' +
997 - '</td>' +
998 - '</tr>' +
999 - '</table>'
 958+ $uploadTableRow = $j('<tr />').append(
 959+ $j('<td />').attr( {
 960+ 'valign':'top'
 961+ } )
 962+ .css({
 963+ 'width' : '350px',
 964+ 'padding-right' : '12px'
 965+ })
 966+ .append(
 967+ $j('<h4 />').text( uploadMsg ),
 968+ $j('<div />').attr({
 969+ 'id': 'upload_form'
 970+ })
 971+ .loadingSpinner()
 972+ ),
 973+
 974+ $j('<td />').attr( {
 975+ 'valign' : 'top',
 976+ 'id':'upload_bin'
 977+ } )
 978+ .loadingSpinner()
 979+ )
 980+ $j( '#rsd_results_container' ).html(
 981+ $j('<table />').append(
 982+ $uploadTableRow
 983+ )
1000984 );
1001985
1002986 // Fill in the user uploads:
1003987 if ( typeof wgUserName != 'undefined' && wgUserName ) {
1004988 // Load the upload bin with anything the current user has uploaded
1005 - provider.sObj.getUserRecentUploads( wgUserName, function( ) {
 989+ provider.sObj.getUserRecentUploads( wgUserName, function( ) {
 990+ $j('#upload_bin').empty().append(
 991+ $j('<h4 />').text( recentUploadsMsg )
 992+ );
1006993 _this.showResults();
1007994 } );
1008 - } else {
1009 - $j( '#upload_bin_cnt' ).empty();
1010995 }
1011996
1012997 // Deal with the api form upload form directly:
@@ -1334,24 +1319,27 @@
13351320 var o = '';
13361321 var tabSelector = '#rsd_results_container';
13371322 var provider = this.content_providers[ this.current_provider ];
 1323+
13381324
1339 - // TODO: clean this up
1340 - /*
 1325+ // The "upload" tab has special results output target rather than top level
 1326+ // resutls container.
 1327+ // @@todo Clean up by moving the rsd_results_container down in the DOM for selected tab display.
 1328+ // ( will be need once we add left side filter controls
 1329+ // that are exclusive to some providers )
13411330 if ( this.current_provider == 'upload' ) {
1342 - tabSelector = '#upload_bin';
 1331+ $resultsContainer = $j('#upload_bin');
13431332 var provider = _this.content_providers['this_wiki'];
13441333 } else {
13451334 var provider = this.content_providers[ this.current_provider ];
1346 - tabSelector = '#tab-' + this.current_provider;
1347 - // Output the results bar / controls
 1335+ $resultsContainer = $j('#rsd_results_container');
 1336+
 1337+ // Add the results header:
 1338+ $resultsContainer.empty().append( this.createResultsHeader() )
13481339 }
1349 - */
13501340
13511341 // Empty the existing results:
13521342 // $j( tabSelector ).empty();
1353 - this.$resultsContainer.empty();
1354 -
1355 - this.$resultsContainer.append( _this.createResultsHeader() );
 1343+
13561344 var numResults = 0;
13571345
13581346 // Output all the results for the current current_provider
@@ -1361,20 +1349,22 @@
13621350 numResults++;
13631351 } );
13641352 // Put in the tab output (plus clear the output)
1365 - this.$resultsContainer.append( o + '<div style="clear:both"/>' );
 1353+ $resultsContainer.append( o + '<div style="clear:both"/>' );
13661354 }
1367 -
1368 - this.$resultsContainer.append( _this.createResultsFooter() );
 1355+ // @@TODO should abstract footer and header ~outside~ of search results
 1356+ // to have less leakgege with upload tab
 1357+ if ( this.current_provider != 'upload' ) {
 1358+ $resultsContainer.append( _this.createResultsFooter() );
 1359+ }
13691360
1370 - mw.log( 'did numResults :: ' + numResults +
1371 - ' append: ' + $j( '#rsd_q' ).val() );
1372 - // Remove any old search res
 1361+ mw.log( 'did numResults :: ' + numResults + ' append: ' + $j( '#rsd_q' ).val() );
 1362+
 1363+ // Add "no search results" text
13731364 $j( '#rsd_no_search_res' ).remove();
13741365 if ( numResults == 0 ) {
1375 - $j( '#tab-' + provider.id ).append(
1376 - '<span style="padding:10px">' +
1377 - gM( 'rsd_no_results', $j( '#rsd_q' ).val() ) +
1378 - '</span>' );
 1366+ $resultsContainer.append(
 1367+ gM( 'rsd_no_results', $j( '#rsd_q' ).val() )
 1368+ )
13791369 }
13801370 this.addResultBindings();
13811371 },
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js
@@ -316,7 +316,7 @@
317317 callbackFunctions : null,
318318
319319 /**
320 - * Constructor initialises callbackFunctions and playerList
 320+ * Constructor initializes callbackFunctions and playerList
321321 */
322322 init: function( ) {
323323 this.callbackFunctions = new Array();
@@ -1612,7 +1612,7 @@
16131613
16141614 // Make sure the player is
16151615 mw.log( 'performing embed for ' + _this.id );
1616 - // mw.log('shopuld embed:' + embed_code);
 1616+ // mw.log('should embed:' + embed_code);
16171617 $j( '#' + _this.id ).html( _this.getEmbedHTML() );
16181618 },
16191619 /**
@@ -1641,7 +1641,7 @@
16421642
16431643 /**
16441644 * Get Related Clips from a category list
1645 - * Configuration specific ( should be factored into a seperate module )
 1645+ * Configuration specific ( should be factored into a separate module )
16461646 * @parma {Object} catlist List of categories
16471647 */
16481648 getRelatedFromCat:function( catlist ) {
@@ -1962,19 +1962,17 @@
19631963 * Usefull for updating for when new playback system is selected
19641964 */
19651965 refreshControls:function() {
1966 - if ( $j( '#' + this.id + ' .control-bar' ).length == 0 ) {
1967 - mw.log( 'refreshControls::control-bar not present, no refresh' );
 1966+ if ( this.$interface.find( '.control-bar' ).length == 0 ) {
 1967+ mw.log( 'Error: refreshControls::control-bar not present, no refresh' );
19681968 return ;
19691969 }
19701970 // Do update controls:
1971 - $j( '#' + this.id + ' .control-bar' ).html( this.getControls() );
1972 - this.ctrlBuilder.addControlHooks();
1973 -
 1971+ this.$interface.find( '.control-bar' ).html( this.getControls() );
 1972+ this.ctrlBuilder.addControlHooks();
19741973 },
19751974
19761975 /**
19771976 * Show the player
1978 - *
19791977 */
19801978 showPlayer : function () {
19811979 // set-up the local ctrlBuilder instance:
@@ -3031,6 +3029,9 @@
30323030 * players and supported mime types
30333031 * In an ideal world we would query the plugin to get what mime
30343032 * types it supports in practice not always reliable/avaliable
 3033+*
 3034+* We can't cleanly store these values per library since player library is loaded post player detection
 3035+*
30353036 */
30363037
30373038 //Flash based players:
@@ -3038,23 +3039,29 @@
30393040 var kplayer = new mediaPlayer('kplayer', ['video/x-flv', 'video/h264'], 'kplayer');
30403041 var omtkPlayer = new mediaPlayer( 'omtkplayer', ['audio/ogg'], 'omtk' );
30413042
3042 -//Java based player
3043 -var cortadoPlayer = new mediaPlayer( 'cortado', ['video/ogg', 'audio/ogg'], 'java' );
 3043+// Java based player
 3044+var cortadoPlayer = new mediaPlayer( 'cortado', ['video/ogg', 'audio/ogg', 'application/ogg'], 'java' );
30443045
3045 -//Native html5 player
3046 -var videoElementPlayer = new mediaPlayer( 'videoElement', ['video/ogg', 'audio/ogg'], 'native' );
 3046+// Native html5 player
 3047+var videoElementPlayer = new mediaPlayer( 'videoElement', ['video/ogg', 'audio/ogg', 'application/ogg'], 'native' );
30473048
3048 -//VLC player
3049 -var vlcMineList = ['video/ogg', 'audio/ogg', 'video/x-flv', 'video/mp4', 'video/h264'];
 3049+// VLC player
 3050+var vlcMineList = ['video/ogg', 'audio/ogg', 'application/ogg', 'video/x-flv', 'video/mp4', 'video/h264'];
30503051 var vlcPlayer = new mediaPlayer( 'vlc-player', vlcMineList, 'vlc' );
30513052
3052 -//Generic plugin
3053 -var oggPluginPlayer = new mediaPlayer( 'oggPlugin', ['video/ogg'], 'generic' );
 3053+// Generic plugin
 3054+var oggPluginPlayer = new mediaPlayer( 'oggPlugin', ['video/ogg', 'application/ogg'], 'generic' );
30543055
3055 -//HTML player for timed display of html contnet ( used in sequencer )
 3056+// HTML player for timed display of html content
30563057 var htmlPlayer = new mediaPlayer( 'html', ['text/html', 'image/jpeg', 'image/png', 'image/svg'], 'html' );
30573058
 3059+// SMIL player for ( mime types from: http://gonze.com/playlists/playlist-format-survey.html )
 3060+// Only add if playlist module exists
 3061+if( mw.getClassPath( 'playlistEmbed' ) ) {
 3062+ var playlistPlayer = new mediaPlayer( 'playlist', ['application/smil', 'application/xspf+xml', 'audio/mpegurl'], 'playlist' );
 3063+}
30583064
 3065+
30593066 /**
30603067 * mediaPlayers is a collection of mediaPlayer objects supported by the client.
30613068 * @constructor
@@ -3127,14 +3134,12 @@
31283135 getMIMETypePlayers: function( mime_type ) {
31293136 var mime_players = new Array();
31303137 var _this = this;
3131 - var inx = 0;
31323138 if ( this.default_players[mime_type] ) {
3133 - $j.each( this.default_players[mime_type], function( d, lib ) {
3134 - var library = _this.default_players[mime_type][d];
 3139+ $j.each( this.default_players[ mime_type ], function( d, lib ) {
 3140+ var library = _this.default_players[ mime_type ][ d ];
31353141 for ( var i = 0; i < _this.players.length; i++ ) {
31363142 if ( _this.players[i].library == library && _this.players[i].supportsMIMEType( mime_type ) ) {
3137 - mime_players[ inx ] = _this.players[i];
3138 - inx++;
 3143+ mime_players.push( _this.players[i] );
31393144 }
31403145 }
31413146 } );
@@ -3150,7 +3155,7 @@
31513156 * Player for mime type
31523157 * null if no player found
31533158 */
3154 - defaultPlayer : function( mime_type ) {
 3159+ defaultPlayer : function( mime_type ) {
31553160 //mw.log( "get defaultPlayer for " + mime_type );
31563161 var mime_players = this.getMIMETypePlayers( mime_type );
31573162 if ( mime_players.length > 0 )
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/nativeEmbed.js
@@ -266,7 +266,7 @@
267267 play: function() {
268268 this.getPlayerElement();
269269 this.parent_play(); // update interface
270 - if ( this.playerElement ) {
 270+ if ( this.playerElement && this.playerElement.play ) {
271271 this.playerElement.play();
272272 // re-start the monitor:
273273 this.monitor();
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/playListEmbed.js
@@ -1,60 +0,0 @@
2 -/**
3 - * The playlistEmbed object code
4 - * Acts as a playback system for embedPlayer where the src
5 - * is xml with multiple files
6 - *
7 - * Only works with "video" tag browsers
8 - *
9 - * @author: Michael Dale mdale@wikimedia.org
10 - * @license GPL2
11 - *
12 - * supports frame by frame rendering of "smil" and other playlist formats
13 - * supports basic drop frame live playback of "smil" and other playlist formats
14 - *
15 - * Extends the "embedPlayer" and represents the playlist as a single video stream
16 - *
17 - */
18 -var playListEmbed = {
19 -
20 - // Instance Name
21 - instanceOf: 'playListEmbed',
22 -
23 - // Native player supported feature set
24 - supports: {
25 - 'play_head': true,
26 - 'pause': true,
27 - 'fullscreen': false,
28 - 'time_display': true,
29 - 'volume_control': true,
30 - 'overlays': true,
31 - },
32 -
33 - /**
34 - * Return the embed code for the first clip in the playlist
35 - * ( monitor and seek handle clip switching )
36 - */
37 - getEmbedHTML : function () {
38 - var _this = this;
39 - var embed_code = this.getEmbedObj();
40 - mw.log( "embed code: " + embed_code )
41 - setTimeout( function(){
42 - _this.postEmbedJS();
43 - }, 150 );
44 - return embed_code;
45 - },
46 -
47 - /**
48 - * Get the native embed code for clipset at given time and seek
49 - */
50 - getEmbedObj:function() {
51 - // Output Video tag for every clip in next 20s
52 - var eb = '<video ' +
53 - 'id="' + this.pid + '" ' +
54 - 'style="width:' + this.width + 'px;height:' + this.height + 'px;" ' +
55 - 'width="' + this.width + '" height="' + this.height + '" ' +
56 - 'src="' + this.getSrc() + '" ' +
57 - '</video>';
58 - return eb;
59 - },
60 -
61 -}
\ No newline at end of file
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/loader.js
@@ -8,7 +8,9 @@
99 "mw.TimedEffectsEdit" : "modules/Sequencer/mvTimedEffectsEdit.js",
1010 "mw.FirefoggRender" : "modules/Sequencer/mw.FirefoggRender.js",
1111
12 - "RemoteMwSequencer" : "modules/Sequencer/remotes/RemoteMwSequencer.js"
 12+ "RemoteMwSequencer" : "modules/Sequencer/remotes/RemoteMwSequencer.js",
 13+
 14+ "playlistEmbed" : "modules/Sequencer/playlistEmbed.js"
1315 } );
1416
1517 mw.addModuleLoader( 'FirefoggRender', function( callback) {
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/playlistEmbed.js
@@ -0,0 +1,66 @@
 2+/**
 3+ * The playlistEmbed object code
 4+ * Acts as a playback system for embedPlayer where the src
 5+ * is smil xml or other playlist xml
 6+ *
 7+ * Only works with "video" tag browsers
 8+ *
 9+ * @author: Michael Dale mdale@wikimedia.org
 10+ * @license GPL2
 11+ *
 12+ * supports frame by frame rendering of "smil" and other playlist formats
 13+ * supports basic drop frame live playback of "smil" and other playlist formats
 14+ *
 15+ * Extends the "embedPlayer" and represents the playlist as a single video stream
 16+ *
 17+ */
 18+var playlistEmbed = {
 19+
 20+ // Instance Name
 21+ instanceOf: 'playListEmbed',
 22+
 23+ // Native player supported feature set
 24+ supports: {
 25+ 'play_head': true,
 26+ 'pause': true,
 27+ 'fullscreen': false,
 28+ 'time_display': true,
 29+ 'volume_control': true,
 30+ 'overlays': true,
 31+ },
 32+
 33+ /**
 34+ * put the embed player into the container
 35+ */
 36+ doEmbedPlayer: function(){
 37+ var _this = this;
 38+ // Set "loading" here:
 39+ $j(this).text( gM( 'mwe-loading_plugin' ) );
 40+
 41+ // Get the clips in range
 42+
 43+ // Start loading all the assets
 44+
 45+ },
 46+
 47+ /**
 48+ * Get the thumbnail html
 49+ */
 50+ getThumbnailHTML: function(){
 51+ return 'thumb html';
 52+ }
 53+ /**
 54+ * Seeks to the requested time and issues a callback when ready / displayed
 55+ * (should be overwritten by client that supports frame serving)
 56+ */
 57+ setCurrentTime: function( time, callback ) {
 58+
 59+ },
 60+
 61+ /**
 62+ * Get all the "clips" in a given range from currentTime
 63+ */
 64+ getClipsInRange: function( range ){
 65+
 66+ }
 67+}
\ No newline at end of file
Property changes on: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/playlistEmbed.js
___________________________________________________________________
Name: svn:mergeinfo
168 + /branches/REL1_15/phase3/js2/mwEmbed/libSequencer/mvPlayList.js:51646
/branches/sqlite/js2/mwEmbed/libSequencer/mvPlayList.js:58211-58321
Name: svn:eol-style
269 + native
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.PlayList.js
@@ -678,7 +678,7 @@
679679 this.cur_clip.embed.stop();
680680 },
681681 updateCurrentClip : function( new_clip , into_perc) {
682 - mw.log( 'f:updateCurrentClip:' + new_clip.id );
 682+ //mw.log( 'f:updateCurrentClip:' + new_clip.id );
683683
684684 // keep the active play clip in sync (stop the other clip)
685685 if ( this.cur_clip ) {
@@ -862,7 +862,8 @@
863863 // playlist stops playback for the current clip (and resets state for start clips)
864864 stop:function() {
865865 var _this = this;
866 - mw.log("mw.PlayList stop:"+ this.start_clip.id + ' c:'+this.cur_clip.id);
 866+ //mw.log("mw.PlayList stop:"+ this.start_clip.id + ' c:'+this.cur_clip.id);
 867+ this.updatePlayHead(0);
867868 this.setupClipDisplay();
868869 },
869870 doSeek:function( v ) {
@@ -880,7 +881,7 @@
881882 return '';
882883 },
883884 setCurrentTime: function( time, callback ) {
884 - mw.log( 'pl:setCurrentTime:' + time );
 885+ //mw.log( 'pl:setCurrentTime:' + time );
885886 var _this = this;
886887 _this.currentTime = time;
887888
@@ -1599,7 +1600,7 @@
16001601 * @param offSetTime default value 0 if we need to start rendering from a given time
16011602 */
16021603 doInitTransition:function( tObj ) {
1603 - mw.log( 'mvTransLib:f:doInitTransition' );
 1604+ //mw.log( 'mvTransLib:f:doInitTransition' );
16041605 if ( !tObj.type ) {
16051606 mw.log( 'transition is missing type attribute' );
16061607 return false;
@@ -1705,7 +1706,7 @@
17061707 fadeFromColor: {
17071708 'attr' : ['fadeColor'],
17081709 'init' : function( tObj ) {
1709 - mw.log('f:fadeFromColor: '+tObj.overlay_selector_id +' to color: '+ tObj.fadeColor);
 1710+ //mw.log('f:fadeFromColor: '+tObj.overlay_selector_id +' to color: '+ tObj.fadeColor);
17101711 if ( !tObj.fadeColor )
17111712 mw.log( 'missing fadeColor' );
17121713 if ( $j( '#' + tObj.overlay_selector_id ).length == 0 ) {
@@ -1730,7 +1731,7 @@
17311732 crossfade: {
17321733 "attr" : [],
17331734 "init" : function( tObj ) {
1734 - mw.log( 'f:crossfade: ' + tObj.overlay_selector_id );
 1735+ //mw.log( 'f:crossfade: ' + tObj.overlay_selector_id );
17351736 if ( $j( '#' + tObj.overlay_selector_id ).length == 0 )
17361737 mw.log( "ERROR overlay selector not found: " + tObj.overlay_selector_id );
17371738
Index: branches/js2-work/phase3/js/mwEmbed/mwEmbed.js
@@ -956,7 +956,7 @@
957957 }
958958
959959 // Check for javascript class
960 - if( this.classPaths[ loadRequest ] ){
 960+ if( this.getClassPath( loadRequest ) ){
961961 mw.log('mw.load: loadClass: ' + loadRequest );
962962 this.loadClass( loadRequest, callback );
963963 return ;
@@ -1067,7 +1067,7 @@
10681068 var coma = '';
10691069 for( var i=0; i < groupedLoadSet.length; i++ ) {
10701070 var loadName = groupedLoadSet[ i ];
1071 - if( this.classPaths[ loadName ] ) {
 1071+ if( this.getClassPath( loadName ) ) {
10721072 // Only add to group request if not already set:
10731073 if ( !mw.isset( loadName ) ){
10741074 groupClassKey += coma + loadName
@@ -1152,7 +1152,7 @@
11531153 scriptRequest = className;
11541154 }else{
11551155 // Get the class url:
1156 - var baseClassPath = this.classPaths[ className ];
 1156+ var baseClassPath = this.getClassPath( className );
11571157 // Add the mwEmbed path if not a root path or a full url
11581158 if( baseClassPath.indexOf( '/' ) !== 0 &&
11591159 baseClassPath.indexOf('://') === -1 ){
@@ -1177,7 +1177,7 @@
11781178 // Issue the request to load the class (include class name in result callback:
11791179 mw.getScript( scriptRequest, function( scriptRequest ) {
11801180 if(! mw.isset( className ) && callback){
1181 - mw.log( 'Possible Error: ' + className +' not set in time, or not defined in:' + "\n" + _this.classPaths[ className ] );
 1181+ mw.log( 'Possible Error: ' + className +' not set in time, or not defined in:' + "\n" + _this.getClassPath( className ) );
11821182 }
11831183 // make sure callback is set and mwLoadDoneCB has not been called
11841184 if( callback ){
@@ -1235,6 +1235,16 @@
12361236 }
12371237 },
12381238
 1239+ /**
 1240+ * get a class path forom a className
 1241+ * if no class found return false
 1242+ */
 1243+ getClassPath: function( className ){
 1244+ if( this.classPaths[ className ] )
 1245+ return this.classPaths[ className ]
 1246+ return false;
 1247+ },
 1248+
12391249 /**
12401250 * Add a style sheet to be loaded the same time as the requested class
12411251 *
@@ -1288,8 +1298,13 @@
12891299 mw.addClassFilePaths = function ( classSet ) {
12901300 return mw.loader.addClassFilePaths( classSet );
12911301 }
1292 -
12931302 /**
 1303+ * Get Class File Path entry point:
 1304+ */
 1305+ mw.getClassPath = function( className ) {
 1306+ return mw.loader.getClassPath( className );
 1307+ }
 1308+ /**
12941309 * Add Class Style Sheet entry point:
12951310 */
12961311 mw.addClassStyleSheets = function( sheetSet ){
@@ -1767,7 +1782,7 @@
17681783 }
17691784 }
17701785 };
1771 - mw.log(" append script: " + script.src );
 1786+ //mw.log(" append script: " + script.src );
17721787 // Append the script to the DOM:
17731788 head.appendChild( script );
17741789 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r61202* Removed tab search model...shmichael14:27, 18 January 2010

Comments

#Comment by Spamsplace (talk | contribs)   22:55, 18 January 2010

Regarding TODO remarks: @@todo Clean up by moving the rsd_results_container down in the DOM for selected tab display. ( will be need once we add left side filter controls

@@TODO should abstract footer and header ~outside~ of search results to have less leakgege with upload tab

I believe rsd_results_container should hold within it the filter controls, that way there is a perfect clean-up when switching to a different provider. Also, I don't like how upload is treated right now. Why does it share the business logic of search results? If we separate it to use entirely different functions we prevent "leakage" and cleaning rsd_results_container provides a safe transitioning.

What do you think?

#Comment by Mdale (talk | contribs)   20:17, 19 January 2010

I agree. rsd_results_container should be named more generally. The upload has to share some logic with the search results since it does a search for files the current user has recently "uploaded". The todo is agreeing with what your saying ie the upload "tab" should not share "business logic" with search provider, and the "search" should be abstracted so both upload "tab" and search provider "tabs" can share the search results layout logic.

Status & tagging log