Bug 847839 - Part 1a: Port XUL Fennec's VideoPlayer to Native Fennec. r=mfinkle
authorChris Peterson <cpeterson@mozilla.com>
Thu, 07 Mar 2013 14:44:22 +0000
changeset 125483 8f93de36b3bc3f7ede7ce5f3e2ce88b2365f4ae1
parent 125482 1f9af1a5c45b2c5af7c4169457cbc5d32cb16540
child 125484 a93c2f4828ae404583f730fda1d8bf52a78c4633
push id24459
push useremorley@mozilla.com
push dateWed, 20 Mar 2013 11:46:36 +0000
treeherdermozilla-central@1d6fe70c79c5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs847839
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 847839 - Part 1a: Port XUL Fennec's VideoPlayer to Native Fennec. r=mfinkle
embedding/android/VideoPlayer.java
embedding/android/resources/layout/videoplayer.xml
mobile/android/base/AndroidManifest.xml.in
mobile/android/base/GeckoAppShell.java
mobile/android/base/Makefile.in
mobile/android/base/VideoPlayer.java
mobile/android/base/resources/layout/videoplayer.xml
--- a/mobile/android/base/AndroidManifest.xml.in
+++ b/mobile/android/base/AndroidManifest.xml.in
@@ -221,16 +221,24 @@
                   android:theme="@style/Gecko.Translucent">
             <intent-filter>
                 <action android:name="android.intent.action.CREATE_SHORTCUT" />
                 <category android:name="android.intent.category.DEFAULT" />
             </intent-filter>
         </activity>
         -->
 
+        <activity android:name="org.mozilla.gecko.VideoPlayer"
+                  android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation"
+                  android:theme="@android:style/Theme.NoTitleBar">
+            <intent-filter>
+                <action android:name="org.mozilla.gecko.PLAY_VIDEO" />
+            </intent-filter>
+        </activity>
+
         <activity android:name="org.mozilla.gecko.AwesomeBar"
                   android:theme="@style/Gecko.Light.AwesomeBar"
                   android:configChanges="orientation|screenSize"
                   android:windowSoftInputMode="stateAlwaysVisible|adjustResize"/>
 
         <activity android:name="org.mozilla.gecko.GeckoPreferences"
                   android:theme="@style/Gecko.TitleBar.Preferences"
                   android:label="@string/settings_title"
--- a/mobile/android/base/GeckoAppShell.java
+++ b/mobile/android/base/GeckoAppShell.java
@@ -1055,17 +1055,26 @@ public class GeckoAppShell
             return intent;
         }
 
         if (!isUriSafeForScheme(uri)) {
             return null;
         }
 
         final String scheme = uri.getScheme();
-        final Intent intent = getIntentForActionString(action);
+
+        final Intent intent;
+        if ("vnd.youtube".equals(scheme) && getHandlersForURL(targetURI, action).length == 0) {
+            // Special case youtube to fallback to our own player
+            intent = new Intent(VideoPlayer.VIDEO_ACTION);
+            intent.setClassName(GeckoApp.mAppContext.getPackageName(),
+                                "org.mozilla.gecko.VideoPlayer");
+        } else {
+            intent = getIntentForActionString(action);
+        }
 
         // Start with the original URI. If we end up modifying it,
         // we'll overwrite it.
         intent.setData(uri);
 
         // Have a special handling for the SMS, as the message body
         // is not extracted from the URI automatically.
         if (!"sms".equals(scheme)) {
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -149,16 +149,17 @@ FENNEC_JAVA_FILES = \
   TabsPanel.java \
   TabsTray.java \
   TabsAccessor.java \
   TailTouchDelegate.java \
   Telemetry.java \
   TextSelection.java \
   TextSelectionHandle.java \
   ThumbnailHelper.java \
+  VideoPlayer.java \
   WebAppAllocator.java \
   ZoomConstraints.java \
   gfx/Axis.java \
   gfx/BitmapUtils.java \
   gfx/BufferedCairoImage.java \
   gfx/CairoGLInfo.java \
   gfx/CairoImage.java \
   gfx/CairoUtils.java \
@@ -425,16 +426,17 @@ RES_LAYOUT = \
   res/layout/select_dialog_list.xml \
   res/layout/select_dialog_multichoice.xml \
   res/layout/abouthome_addon_row.xml \
   res/layout/abouthome_last_tabs_row.xml \
   res/layout/abouthome_section.xml \
   res/layout/abouthome_remote_tab_row.xml \
   res/layout/abouthome_topsite_item.xml \
   res/layout/validation_message.xml \
+  res/layout/videoplayer.xml \
   $(NULL)
 
 RES_LAYOUT_LAND_V14 = \
   res/layout-land-v14/browser_toolbar.xml \
   res/layout-land-v14/browser_toolbar_menu.xml \
   $(NULL)
 
 RES_LAYOUT_LARGE_V11 = \
rename from embedding/android/VideoPlayer.java
rename to mobile/android/base/VideoPlayer.java
rename from embedding/android/resources/layout/videoplayer.xml
rename to mobile/android/base/resources/layout/videoplayer.xml