Index: trunk/extensions/AddMediaWizard/AddMedia/mw.Firefogg.js |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | mw.addMessages({ |
8 | 8 | "mwe-upload-transcoded-status" : "Transcoded", |
9 | 9 | "mwe-upload-transcode-in-progress" : "Transcode and upload in progress (do not close this window)", |
10 | | - "fogg-transcoding" : "Encoding video to Ogg", |
| 10 | + "fogg-transcoding" : "Encoding video", |
11 | 11 | "fogg-select_file" : "Select file", |
12 | 12 | "fogg-select_new_file" : "Select new file", |
13 | 13 | "fogg-select_url" : "Select URL", |
— | — | @@ -634,8 +634,7 @@ |
635 | 635 | if ( v.src != _this.fogg.previewUrl ) { |
636 | 636 | mw.log( 'init preview with url:' + _this.fogg.previewUrl ); |
637 | 637 | v.src = _this.fogg.previewUrl; |
638 | | - |
639 | | - // Once it's loaded, seek to the end |
| 638 | + // Once it's loaded, seek to the end ( for ogg ) |
640 | 639 | v.removeEventListener( "loadedmetadata", seekToEnd, true ); |
641 | 640 | v.addEventListener( "loadedmetadata", seekToEnd, true ); |
642 | 641 | |
— | — | @@ -647,7 +646,7 @@ |
648 | 647 | var previewTimer = setInterval( function() { |
649 | 648 | if ( _this.fogg.status() != "encoding" ) { |
650 | 649 | clearInterval( previewTimer ); |
651 | | - _this.show_preview == false; // Closure compiler marks this as irrelevant -papy |
| 650 | + _this.show_preview == false; |
652 | 651 | } |
653 | 652 | if ( _this.show_preview == true ) { |
654 | 653 | v.load(); |
— | — | @@ -784,7 +783,7 @@ |
785 | 784 | doLocalEncodeAndSave: function() { |
786 | 785 | var _this = this; |
787 | 786 | if ( !this.fogg ) { |
788 | | - mw.log( 'doLocalEncodeAndSave: no Firefogg object!' ); |
| 787 | + mw.log( 'Error: doLocalEncodeAndSave: no Firefogg object!' ); |
789 | 788 | return false; |
790 | 789 | } |
791 | 790 | // Setup the interface progress indicator: |
— | — | @@ -792,8 +791,9 @@ |
793 | 792 | 'title' : gM( 'fogg-transcoding' ), |
794 | 793 | 'statusType' : 'transcode' |
795 | 794 | } ); |
| 795 | + |
796 | 796 | // Add the preview controls if transcoding: |
797 | | - if ( !_this.getEncoderSettings()[ 'passthrough' ] ) { |
| 797 | + if ( !_this.getEncoderSettings()[ 'passthrough' ] && _this.current_encoder_settings['videoCodec'] != 'vp8' ) { |
798 | 798 | _this.createPreviewControls(); |
799 | 799 | } |
800 | 800 | |
— | — | @@ -801,6 +801,7 @@ |
802 | 802 | // Firefogg shows the "save as" dialog box, and sets the path chosen as |
803 | 803 | // the destination for a later encode() call. |
804 | 804 | if ( !this.fogg.saveVideoAs() ) { |
| 805 | + _this.ui.close(); |
805 | 806 | // User clicked "cancel" |
806 | 807 | return false; |
807 | 808 | } |
— | — | @@ -824,7 +825,7 @@ |
825 | 826 | var _this = this; |
826 | 827 | _this.ui.setPrompt( gM( 'fogg-encoding-done' ), |
827 | 828 | gM( 'fogg-encoding-done' ) + '<br>' + |
828 | | - //show the video at full resolution upto 720px wide |
| 829 | + // Show the video at full resolution upto 720px wide |
829 | 830 | '<video controls="true" style="margin:auto" id="fogg_final_vid" '+ |
830 | 831 | 'src="' +_this.fogg.previewUrl + '"></video>' |
831 | 832 | ); |
— | — | @@ -895,7 +896,14 @@ |
896 | 897 | ' passthrough:' + settings['passthrough'] ); |
897 | 898 | |
898 | 899 | this.current_encoder_settings = settings; |
| 900 | + } |
| 901 | + //Update the format based on codec selection |
| 902 | + if( this.current_encoder_settings['videoCodec'] == 'vp8' ){ |
| 903 | + this.fogg.setFormat('webm'); |
| 904 | + } else { |
| 905 | + this.fogg.setFormat('ogg'); |
899 | 906 | } |
| 907 | + |
900 | 908 | return this.current_encoder_settings; |
901 | 909 | }, |
902 | 910 | |
— | — | @@ -1131,6 +1139,8 @@ |
1132 | 1140 | |
1133 | 1141 | var encoderSettings = this.getEncoderSettings(); |
1134 | 1142 | |
| 1143 | + // Check for special encode settings that remap things. |
| 1144 | + |
1135 | 1145 | // Check if encoderSettings passthrough is on ( then skip the encode ) |
1136 | 1146 | if( encoderSettings['passthrough'] == true) { |
1137 | 1147 | // Firefogg requires an encode request to setup a the file to be uploaded. |
— | — | @@ -1147,7 +1157,10 @@ |
1148 | 1158 | var encodingStatus = function() { |
1149 | 1159 | var status = _this.fogg.status(); |
1150 | 1160 | |
1151 | | - if ( _this.show_preview == true && _this.fogg.state == 'encoding' ) { |
| 1161 | + if ( _this.show_preview == true |
| 1162 | + && _this.fogg.state == 'encoding' |
| 1163 | + // No way to seek in VP8 atm |
| 1164 | + && _this.current_encoder_settings['videoCodec'] != 'vp8') { |
1152 | 1165 | _this.renderPreview(); |
1153 | 1166 | } |
1154 | 1167 | |
Index: trunk/extensions/AddMediaWizard/AddMedia/mw.FirefoggGUI.js |
— | — | @@ -3,7 +3,8 @@ |
4 | 4 | */ |
5 | 5 | |
6 | 6 | mw.addMessages({ |
7 | | - "fogg-save_local_file" : "Save Ogg", |
| 7 | + "fogg-wont-upload-to-server" : "Note: Your video file will be locally encoded and not upload to any server", |
| 8 | + "fogg-save_local_file" : "Encode to File", |
8 | 9 | "fogg-help-sticky" : "Help (click to stick)", |
9 | 10 | "fogg-cg-preset" : "Preset: <strong>$1<\/strong>", |
10 | 11 | "fogg-cg-quality" : "Basic quality and resolution control", |
— | — | @@ -12,9 +13,11 @@ |
13 | 14 | "fogg-cg-advVideo" : "Advanced video encoding controls", |
14 | 15 | "fogg-cg-advAudio" : "Advanced audio encoding controls", |
15 | 16 | "fogg-preset-custom" : "Custom settings", |
16 | | - "fogg-webvideo-desc" : "Web video Theora, Vorbis 400 kbit\/s and 400px maximum width", |
17 | | - "fogg-savebandwidth-desc" : "Low bandwidth Theora, Vorbis 164 kbit\/s and 200px maximum width", |
18 | | - "fogg-highquality-desc" : "High quality Theora, Vorbis 1080px maximum width", |
| 17 | + "fogg-webvideo-desc" : "Ogg Web video Theora, Vorbis 600 kbit\/s and 400px maximum width", |
| 18 | + "fogg-savebandwidth-desc" : "Ogg Low bandwidth Theora, Vorbis 164 kbit\/s and 200px maximum width", |
| 19 | + "fogg-highquality-desc" : "Ogg High quality Theora, Vorbis 1080px maximum width", |
| 20 | + "fogg-webvideo-webm-desc" : "Webm Web video VP8 600 kbit\/s and 480px maximum width", |
| 21 | + "fogg-highquality-webm-desc" : "Webm High quality VP8 1080px maximum width", |
19 | 22 | "fogg-videoQuality-title" : "Video quality", |
20 | 23 | "fogg-videoQuality-help" : "Used to set the <i>visual quality<\/i> of the encoded video (not used if you set bitrate in advanced controls below).", |
21 | 24 | "fogg-starttime-title" : "Start second", |
— | — | @@ -24,7 +27,7 @@ |
25 | 28 | "fogg-audioQuality-title" : "Audio quality", |
26 | 29 | "fogg-audioQuality-help" : "Used to set the <i>acoustic quality<\/i> of the encoded audio (not used if you set bitrate in advanced controls below).", |
27 | 30 | "fogg-videoCodec-title" : "Video codec", |
28 | | - "fogg-videoCodec-help" : "Used to select the clip video codec. Presently only Theora is supported. More about the <a target=\"_new\" href=\"http:\/\/en.wikipedia.org\/wiki\/Theora\">Theora codec<\/a>.", |
| 31 | + "fogg-videoCodec-help" : "Select the clip video codec. More about the <a target=\"_new\" href=\"http:\/\/en.wikipedia.org\/wiki\/Theora\">Theora codec<\/a>. More about the <a target=\"_new\" href=\"http:\/\/en.wikipedia.org\/wiki\/Webm\">VP8 codec<\/a>", |
29 | 32 | "fogg-audioCodec-title" : "Audio codec", |
30 | 33 | "fogg-audioCodec-help" : "Used to set the clip audio codec. Presently only Vorbis is supported. More about the <a target=\"_new\" href=\"http:\/\/en.wikipedia.org\/wiki\/Vorbis\">Vorbis codec<\/a>", |
31 | 34 | "fogg-width-title" : "Video width", |
— | — | @@ -121,7 +124,7 @@ |
122 | 125 | 'custom': { |
123 | 126 | 'descKey': 'fogg-preset-custom', |
124 | 127 | 'conf': {} |
125 | | - }, |
| 128 | + }, |
126 | 129 | 'webvideo': { |
127 | 130 | 'desc': gM( 'fogg-webvideo-desc' ), |
128 | 131 | 'conf': { |
— | — | @@ -151,11 +154,31 @@ |
152 | 155 | 'audioQuality' : 3, |
153 | 156 | 'noUpscaling' : true |
154 | 157 | } |
| 158 | + }, |
| 159 | + 'webvideo_webm': { |
| 160 | + 'desc': gM( 'fogg-webvideo-webm-desc' ), |
| 161 | + 'conf': { |
| 162 | + 'videoCodec' : 'vp8', |
| 163 | + 'maxSize' : 480, |
| 164 | + 'videoBitrate' : 544, |
| 165 | + 'audioBitrate' : 96, |
| 166 | + 'noUpscaling' : true |
| 167 | + } |
| 168 | + }, |
| 169 | + 'webvideo_webmhq': { |
| 170 | + 'desc' : gM('fogg-highquality-webm-desc'), |
| 171 | + 'conf' : { |
| 172 | + 'videoCodec' : 'vp8', |
| 173 | + 'maxSize' : 1080, |
| 174 | + 'videoQuality' : 6, |
| 175 | + 'audioQuality' : 3, |
| 176 | + 'noUpscaling' : true |
| 177 | + } |
155 | 178 | } |
156 | 179 | } |
157 | 180 | }, |
158 | 181 | |
159 | | - // Customised configuration hashtable |
| 182 | + // Customized configuration hashtable |
160 | 183 | local_settings: {}, |
161 | 184 | |
162 | 185 | // Core Firefogg default encoder configuration |
— | — | @@ -184,7 +207,7 @@ |
185 | 208 | }, |
186 | 209 | 'videoCodec': { |
187 | 210 | 'default' : "theora", |
188 | | - 'selectVal' : [ 'theora' ], |
| 211 | + 'selectVal' : [ 'theora', 'vp8' ], |
189 | 212 | 'type' : "select", |
190 | 213 | 'group' : "quality" |
191 | 214 | }, |
— | — | @@ -452,7 +475,6 @@ |
453 | 476 | '</span>' + |
454 | 477 | '</label></td><td valign="top">'; |
455 | 478 | // Get the default value (or an empty string if there is no default) |
456 | | - |
457 | 479 | var defaultValue = this.default_encoder_config[configKey]['default']; |
458 | 480 | if ( !defaultValue ) { |
459 | 481 | defaultValue = ''; |
— | — | @@ -497,7 +519,7 @@ |
498 | 520 | for ( var i in configEntry.selectVal ) { |
499 | 521 | var val = configEntry.selectVal[i]; |
500 | 522 | if ( typeof val == 'string' ) { |
501 | | - var sel = ( configEntry.selectVal[i] == val ) ? ' selected' : ''; |
| 523 | + var sel = ( defaultValue == val ) ? ' selected' : ''; |
502 | 524 | out += '<option value="' + val + '"'+sel+'>' + val + '</option>'; |
503 | 525 | } else if ( typeof val == 'object' ) { |
504 | 526 | for ( var key in val ) { |
— | — | @@ -738,16 +760,17 @@ |
739 | 761 | /** |
740 | 762 | * Update the UI due to a change in preset |
741 | 763 | */ |
742 | | - updatePresetSelection: function( presetKey ) { |
| 764 | + updatePresetSelection: function( presetKey ) { |
743 | 765 | // Update the local configuration |
744 | | - this.local_settings['default'] = presetKey; |
| 766 | + this.local_settings['default'] = presetKey; |
745 | 767 | mw.log( 'update preset desc: ' + presetKey ); |
746 | 768 | var presetDesc = ''; |
747 | 769 | if ( this.local_settings.presets[presetKey].desc ) { |
748 | 770 | presetDesc = this.local_settings.presets[presetKey].desc; |
749 | 771 | } else { |
750 | 772 | presetDesc = gM( 'fogg-preset-' + presetKey ); |
751 | | - } |
| 773 | + } |
| 774 | + |
752 | 775 | // Update the preset title |
753 | 776 | $j( this.selector + ' .gd_preset' ) |
754 | 777 | .html( gM( 'fogg-cg-preset', presetDesc ) ); |
— | — | @@ -755,7 +778,7 @@ |
756 | 779 | $j( this.selector + ' ._preset_select' ).val( presetKey ); |
757 | 780 | }, |
758 | 781 | |
759 | | - /* |
| 782 | + /** |
760 | 783 | * Update the interface due to a change in a particular config key |
761 | 784 | */ |
762 | 785 | updateInterfaceValue: function( confKey, val ) { |
— | — | @@ -852,9 +875,10 @@ |
853 | 876 | * into which a video has already been selected. Overrides the base method. |
854 | 877 | */ |
855 | 878 | getEncoderSettings: function() { |
856 | | - if ( this.current_encoder_settings != null ) { |
857 | | - return this.current_encoder_settings; |
858 | | - } |
| 879 | + // update the encoder settings (from local settings) |
| 880 | + var pKey = this.local_settings['default']; |
| 881 | + // Update the current encoder settings: |
| 882 | + this.current_encoder_settings = this.local_settings.presets[ pKey ].conf; |
859 | 883 | |
860 | 884 | // Call the base function |
861 | 885 | // Note that settings will be a reference and can be modified |
— | — | @@ -981,10 +1005,7 @@ |
982 | 1006 | this.updateValuesInHtml(); |
983 | 1007 | }, |
984 | 1008 | |
985 | | - doEncode: function( progressCallback, doneCallback ) { |
986 | | - // update the encoder settings (from local settings) |
987 | | - pKey = this.local_settings['default']; |
988 | | - this.current_encoder_settings = this.local_settings.presets[ pKey ].conf; |
| 1009 | + doEncode: function( progressCallback, doneCallback ) { |
989 | 1010 | this.basefogg_doEncode( progressCallback, doneCallback ); |
990 | 1011 | }, |
991 | 1012 | |
Index: trunk/extensions/AddMediaWizard/AddMedia/mw.RemoteSearchDriver.js |
— | — | @@ -2937,7 +2937,7 @@ |
2938 | 2938 | resource.mime.indexOf( 'video' ) != -1 || |
2939 | 2939 | resource.mime.indexOf( '/ogg' ) != -1 ) |
2940 | 2940 | { |
2941 | | - // Re-load the player module ( will scan page for mw.getConfig( 'rewritePlayerTags' ) ) |
| 2941 | + // Re-load the player module ( will scan page for mw.getConfig( 'EmbedPlayer.RewriteTags' ) ) |
2942 | 2942 | $j.embedPlayers(); |
2943 | 2943 | } |
2944 | 2944 | } |
Index: trunk/extensions/AddMediaWizard/AddMedia/AddMedia.i18n.php |
— | — | @@ -31,7 +31,8 @@ |
32 | 32 | 'mwe-filesource' => 'Source:', |
33 | 33 | 'mwe-filestatus' => 'Copyright status:', |
34 | 34 | 'mwe-loading-add-media-wiz' => 'Loading add media wizard', |
35 | | - 'fogg-save_local_file' => 'Save Ogg', |
| 35 | + 'fogg-wont-upload-to-server' => 'Note: Your video file will be locally encoded and not upload to any server', |
| 36 | + 'fogg-save_local_file' => 'Encode to File', |
36 | 37 | 'fogg-help-sticky' => 'Help (click to stick)', |
37 | 38 | 'fogg-cg-preset' => 'Preset: <strong>$1</strong>', |
38 | 39 | 'fogg-cg-quality' => 'Basic quality and resolution control', |
— | — | @@ -40,9 +41,11 @@ |
41 | 42 | 'fogg-cg-advVideo' => 'Advanced video encoding controls', |
42 | 43 | 'fogg-cg-advAudio' => 'Advanced audio encoding controls', |
43 | 44 | 'fogg-preset-custom' => 'Custom settings', |
44 | | - 'fogg-webvideo-desc' => 'Web video Theora, Vorbis 400 kbit/s and 400px maximum width', |
45 | | - 'fogg-savebandwidth-desc' => 'Low bandwidth Theora, Vorbis 164 kbit/s and 200px maximum width', |
46 | | - 'fogg-highquality-desc' => 'High quality Theora, Vorbis 1080px maximum width', |
| 45 | + 'fogg-webvideo-desc' => 'Ogg Web video Theora, Vorbis 600 kbit\/s and 400px maximum width', |
| 46 | + 'fogg-savebandwidth-desc' => 'Ogg Low bandwidth Theora, Vorbis 164 kbit\/s and 200px maximum width', |
| 47 | + 'fogg-highquality-desc' => 'Ogg High quality Theora, Vorbis 1080px maximum width', |
| 48 | + 'fogg-webvideo-webm-desc' => 'Webm Web video VP8 600 kbit\/s and 480px maximum width', |
| 49 | + 'fogg-highquality-webm-desc' => 'Webm High quality VP8 1080px maximum width', |
47 | 50 | 'fogg-videoQuality-title' => 'Video quality', |
48 | 51 | 'fogg-videoQuality-help' => 'Used to set the <i>visual quality</i> of the encoded video (not used if you set bitrate in advanced controls below).', |
49 | 52 | 'fogg-starttime-title' => 'Start second', |
— | — | @@ -52,7 +55,7 @@ |
53 | 56 | 'fogg-audioQuality-title' => 'Audio quality', |
54 | 57 | 'fogg-audioQuality-help' => 'Used to set the <i>acoustic quality</i> of the encoded audio (not used if you set bitrate in advanced controls below).', |
55 | 58 | 'fogg-videoCodec-title' => 'Video codec', |
56 | | - 'fogg-videoCodec-help' => 'Used to select the clip video codec. Presently only Theora is supported. More about the <a target="_new" href="http://en.wikipedia.org/wiki/Theora">Theora codec</a>.', |
| 59 | + 'fogg-videoCodec-help' => 'Select the clip video codec. More about the <a target=\"_new\" href=\"http:\/\/en.wikipedia.org\/wiki\/Theora\">Theora codec<\/a>. More about the <a target=\"_new\" href=\"http:\/\/en.wikipedia.org\/wiki\/Webm\">VP8 codec<\/a>', |
57 | 60 | 'fogg-audioCodec-title' => 'Audio codec', |
58 | 61 | 'fogg-audioCodec-help' => 'Used to set the clip audio codec. Presently only Vorbis is supported. More about the <a target="_new" href="http://en.wikipedia.org/wiki/Vorbis">Vorbis codec</a>', |
59 | 62 | 'fogg-width-title' => 'Video width', |
— | — | @@ -195,7 +198,7 @@ |
196 | 199 | 'rsd-search-timeout' => 'The search request did not complete. The server may be down experiencing heavy load. You can try again later', |
197 | 200 | 'mwe-upload-transcoded-status' => 'Transcoded', |
198 | 201 | 'mwe-upload-transcode-in-progress' => 'Transcode and upload in progress (do not close this window)', |
199 | | - 'fogg-transcoding' => 'Encoding video to Ogg', |
| 202 | + 'fogg-transcoding' => 'Encoding video', |
200 | 203 | 'fogg-select_file' => 'Select file', |
201 | 204 | 'fogg-select_new_file' => 'Select new file', |
202 | 205 | 'fogg-select_url' => 'Select URL', |