Bug 1062112: Part 3: Move GeckoMediaPlayer. r=nalexander
authorChris Kitching <chriskitching@linux.com>
Thu, 04 Sep 2014 00:16:47 -0700
changeset 227338 d2d463e509c3b48bbd0b929d1c5975ccc7559695
parent 227337 6177ae59bd241072c6aef6b8063d62ad9b40fe9d
child 227339 e6163044265f2f361af81feb7859188875192ca8
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1062112
milestone35.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 1062112: Part 3: Move GeckoMediaPlayer. r=nalexander
mobile/android/base/GeckoMediaPlayer.java
mobile/android/base/MediaPlayerManager.java
mobile/android/base/moz.build
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/GeckoMediaPlayer.java
@@ -0,0 +1,22 @@
+/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package org.mozilla.gecko;
+
+import org.json.JSONObject;
+import org.mozilla.gecko.util.EventCallback;
+
+/* Wrapper for MediaRouter types supported by Android, such as Chromecast, Miracast, etc. */
+interface GeckoMediaPlayer {
+    JSONObject toJSON();
+    void load(String title, String url, String type, EventCallback callback);
+    void play(EventCallback callback);
+    void pause(EventCallback callback);
+    void stop(EventCallback callback);
+    void start(EventCallback callback);
+    void end(EventCallback callback);
+    void mirror(EventCallback callback);
+    void message(String message, EventCallback callback);
+}
--- a/mobile/android/base/MediaPlayerManager.java
+++ b/mobile/android/base/MediaPlayerManager.java
@@ -22,29 +22,16 @@ import android.support.v7.media.MediaRou
 import android.util.Log;
 
 import com.google.android.gms.cast.CastMediaControlIntent;
 
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Iterator;
 
-/* Wraper for different MediaRouter types supproted by Android. i.e. Chromecast, Miracast, etc. */
-interface GeckoMediaPlayer {
-    public JSONObject toJSON();
-    public void load(String title, String url, String type, EventCallback callback);
-    public void play(EventCallback callback);
-    public void pause(EventCallback callback);
-    public void stop(EventCallback callback);
-    public void start(EventCallback callback);
-    public void end(EventCallback callback);
-    public void mirror(EventCallback callback);
-    public void message(String message, EventCallback callback);
-}
-
 /* Manages a list of GeckoMediaPlayers methods (i.e. Chromecast/Miracast). Routes messages
  * from Gecko to the correct caster based on the id of the display
  */
 class MediaPlayerManager implements NativeEventListener,
                                     GeckoAppShell.AppStateListener {
     private static final String LOGTAG = "GeckoMediaPlayerManager";
 
     private static final boolean SHOW_DEBUG = false;
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -515,16 +515,17 @@ gbjar.extra_jars = [
 
 moz_native_devices_jars = [
     CONFIG['ANDROID_APPCOMPAT_LIB'],
     CONFIG['ANDROID_MEDIAROUTER_LIB'],
     CONFIG['GOOGLE_PLAY_SERVICES_LIB'],
 ]
 moz_native_devices_sources = [
     'ChromeCast.java',
+    'GeckoMediaPlayer.java',
     'MediaPlayerManager.java',
 ]
 if CONFIG['MOZ_NATIVE_DEVICES']:
     gbjar.extra_jars += moz_native_devices_jars
     gbjar.sources += moz_native_devices_sources
 
 gbjar.javac_flags += ['-Xlint:all,-deprecation,-fallthrough']