summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/drawable-hdpi/ic_menu_disabled_stop.pngbin2863 -> 0 bytes
-rw-r--r--res/drawable-hdpi/ic_menu_stop.pngbin2864 -> 0 bytes
-rw-r--r--res/drawable-mdpi/ic_menu_disabled_stop.pngbin2850 -> 0 bytes
-rw-r--r--res/drawable-mdpi/ic_menu_stop.pngbin2841 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/ic_menu_disabled_stop.pngbin2904 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/ic_menu_stop.pngbin2904 -> 0 bytes
-rw-r--r--res/drawable/ic_media_live.xml43
-rw-r--r--res/drawable/ic_menu_disabled_stop.xml39
-rw-r--r--res/drawable/ic_menu_stop.xml39
-rw-r--r--res/layout/movie_view.xml8
-rw-r--r--res/values/dimens.xml1
-rw-r--r--src/com/android/gallery3d/app/MovieActivity.java9
-rw-r--r--src/com/android/gallery3d/app/MovieControllerOverlay.java7
-rw-r--r--src/com/android/gallery3d/app/MovieControllerOverlayNew.java61
-rwxr-xr-xsrc/com/android/gallery3d/app/MoviePlayer.java3
-rw-r--r--src/com/android/gallery3d/app/TimeBarNew.java10
16 files changed, 214 insertions, 6 deletions
diff --git a/res/drawable-hdpi/ic_menu_disabled_stop.png b/res/drawable-hdpi/ic_menu_disabled_stop.png
deleted file mode 100644
index 292c49241..000000000
--- a/res/drawable-hdpi/ic_menu_disabled_stop.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_menu_stop.png b/res/drawable-hdpi/ic_menu_stop.png
deleted file mode 100644
index aea1c458a..000000000
--- a/res/drawable-hdpi/ic_menu_stop.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_menu_disabled_stop.png b/res/drawable-mdpi/ic_menu_disabled_stop.png
deleted file mode 100644
index 0532cea84..000000000
--- a/res/drawable-mdpi/ic_menu_disabled_stop.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_menu_stop.png b/res/drawable-mdpi/ic_menu_stop.png
deleted file mode 100644
index 96cf8f46d..000000000
--- a/res/drawable-mdpi/ic_menu_stop.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_menu_disabled_stop.png b/res/drawable-xhdpi/ic_menu_disabled_stop.png
deleted file mode 100644
index ba0fc5f61..000000000
--- a/res/drawable-xhdpi/ic_menu_disabled_stop.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_menu_stop.png b/res/drawable-xhdpi/ic_menu_stop.png
deleted file mode 100644
index 43e77bee4..000000000
--- a/res/drawable-xhdpi/ic_menu_stop.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable/ic_media_live.xml b/res/drawable/ic_media_live.xml
new file mode 100644
index 000000000..d21ce7d0e
--- /dev/null
+++ b/res/drawable/ic_media_live.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2016, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="36dp"
+ android:height="24dp"
+ android:viewportHeight="72.0"
+ android:viewportWidth="108.0">
+ <path
+ android:fillColor="#FFFFFFFF"
+ android:fillAlpha="0.5"
+ android:pathData="M15,0h78c8.3,0 15,6.7 15,15v42c0,8.3 -6.7,15 -15,15H15C6.7,72 0,65.3 0,57V15C0,6.7 6.7,0 15,0z" />
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M24.6,23.2h-5.1v25.6H36v-3.9H24.6V23.2zM44.7,23.2h-5.1v25.6h5.1L44.7,23.2L44.7,23.2zM52.8,23.2h-5.4l8.7,25.6h5.3l8.7,-25.6h-5.4l-5.6,18.7l-0.3,1.4h-0.1l-0.3,-1.4L52.8,23.2zM87,33.6h-9.5v-6.4h11.2v-4H72.4v25.6h16.4v-3.9H77.5v-7.3H87L87,33.6L87,33.6z" />
+</vector>
diff --git a/res/drawable/ic_menu_disabled_stop.xml b/res/drawable/ic_menu_disabled_stop.xml
new file mode 100644
index 000000000..ee062f208
--- /dev/null
+++ b/res/drawable/ic_menu_disabled_stop.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2016, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="48dp"
+ android:height="48dp"
+ android:viewportHeight="180.0"
+ android:viewportWidth="180.0">
+ <path
+ android:fillColor="#FFFFFFFF"
+ android:pathData="M58,58h64v64h-64z" />
+</vector>
diff --git a/res/drawable/ic_menu_stop.xml b/res/drawable/ic_menu_stop.xml
new file mode 100644
index 000000000..ee062f208
--- /dev/null
+++ b/res/drawable/ic_menu_stop.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2016, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="48dp"
+ android:height="48dp"
+ android:viewportHeight="180.0"
+ android:viewportWidth="180.0">
+ <path
+ android:fillColor="#FFFFFFFF"
+ android:pathData="M58,58h64v64h-64z" />
+</vector>
diff --git a/res/layout/movie_view.xml b/res/layout/movie_view.xml
index a08679280..3a412e13e 100644
--- a/res/layout/movie_view.xml
+++ b/res/layout/movie_view.xml
@@ -19,9 +19,17 @@
android:background="@android:color/black"
android:layout_width="match_parent"
android:layout_height="match_parent">
+
<org.codeaurora.gallery3d.video.CodeauroraVideoView android:id="@+id/surface_view"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true" />
+
+ <ImageView
+ android:id="@+id/img_live"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:src="@drawable/ic_media_live"/>
</RelativeLayout>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index ee181e939..87e00eea8 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -209,4 +209,5 @@
<dimen name="timeline_title_font_size">14sp</dimen>
<dimen name="timebar_height">60dp</dimen>
+ <dimen name="livestream_icon_padding">12dp</dimen>
</resources>
diff --git a/src/com/android/gallery3d/app/MovieActivity.java b/src/com/android/gallery3d/app/MovieActivity.java
index 01d8d26b7..8767248ff 100644
--- a/src/com/android/gallery3d/app/MovieActivity.java
+++ b/src/com/android/gallery3d/app/MovieActivity.java
@@ -61,6 +61,7 @@ import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.CompoundButton;
+import android.widget.ImageView;
import android.widget.ShareActionProvider;
import android.widget.ToggleButton;
import android.widget.Toast;
@@ -100,6 +101,7 @@ public class MovieActivity extends Activity {
private MoviePlayer mPlayer;
private boolean mFinishOnCompletion;
private Uri mUri;
+ private ImageView mLiveImg;
private static final short BASSBOOST_MAX_STRENGTH = 1000;
private static final short VIRTUALIZER_MAX_STRENGTH = 1000;
@@ -180,6 +182,8 @@ public class MovieActivity extends Activity {
setSystemUiVisibility(rootView);
+ mLiveImg = (ImageView) findViewById(R.id.img_live);
+
Intent intent = getIntent();
mMovieHooker = ExtensionHelper.getHooker(this);
@@ -262,6 +266,10 @@ public class MovieActivity extends Activity {
}
}
+ public ImageView getLiveImage() {
+ return mLiveImg;
+ }
+
private void initializeActionBar(Intent intent) {
mUri = intent.getData();
final ActionBar actionBar = getActionBar();
@@ -322,6 +330,7 @@ public class MovieActivity extends Activity {
super.onCreateOptionsMenu(menu);
getMenuInflater().inflate(R.menu.movie, menu);
MenuItem shareMenu = menu.findItem(R.id.action_share);
+ shareMenu.setVisible(false);
ShareActionProvider provider = (ShareActionProvider) shareMenu.getActionProvider();
mShareProvider = provider;
if (mShareProvider != null) {
diff --git a/src/com/android/gallery3d/app/MovieControllerOverlay.java b/src/com/android/gallery3d/app/MovieControllerOverlay.java
index 72b95fd38..82b01812e 100644
--- a/src/com/android/gallery3d/app/MovieControllerOverlay.java
+++ b/src/com/android/gallery3d/app/MovieControllerOverlay.java
@@ -66,7 +66,7 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements
private ScreenModeManager mScreenModeManager;
protected ScreenModeExt mScreenModeExt = new ScreenModeExt();
- private ControllerRewindAndForwardExt mControllerRewindAndForwardExt = new ControllerRewindAndForwardExt();
+ protected ControllerRewindAndForwardExt mControllerRewindAndForwardExt = new ControllerRewindAndForwardExt();
private OverlayExtension mOverlayExt = new OverlayExtension();
private boolean hidden;
@@ -781,6 +781,10 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements
private static final int BUTTON_PADDING = 40;
private int mTimeBarHeight = 0;
+ public ImageView getStopBtn() {
+ return mStop;
+ }
+
void init(Context context) {
Log.v(TAG, "ControllerRewindAndForwardExt init");
mTimeBarHeight = mTimeBar.getPreferredHeight();
@@ -815,7 +819,6 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements
LinearLayout.LayoutParams stopLayoutParam = new LinearLayout.LayoutParams(
mTimeBarHeight, mTimeBarHeight);
stopLayoutParam.setMargins(BUTTON_PADDING, 0, BUTTON_PADDING, 0);
- mContollerButtons.addView(mStop, stopLayoutParam);
mForward = new ImageView(context);
mForward.setImageResource(R.drawable.icn_media_forward);
diff --git a/src/com/android/gallery3d/app/MovieControllerOverlayNew.java b/src/com/android/gallery3d/app/MovieControllerOverlayNew.java
index a11a74a51..135591c05 100644
--- a/src/com/android/gallery3d/app/MovieControllerOverlayNew.java
+++ b/src/com/android/gallery3d/app/MovieControllerOverlayNew.java
@@ -33,11 +33,27 @@ import android.content.Context;
import android.graphics.Rect;
import android.view.MotionEvent;
import android.view.View;
+import android.widget.ImageView;
+
+import com.android.gallery3d.R;
+
+import org.codeaurora.gallery3d.video.IControllerRewindAndForward;
public class MovieControllerOverlayNew extends MovieControllerOverlay {
+ private boolean mIsLive = false;
+ private ImageView mLiveImage;
+ private ImageView mStopBtn;
+
+ private int mLiveMargin;
+
public MovieControllerOverlayNew(Context context) {
super(context);
+ mLiveImage = ((MovieActivity) mContext).getLiveImage();
+ mStopBtn = mControllerRewindAndForwardExt.getStopBtn();
+ mLiveMargin = context.getResources().getDimensionPixelSize(
+ R.dimen.livestream_icon_padding);
+ addView(mStopBtn);
}
@Override
@@ -64,7 +80,7 @@ public class MovieControllerOverlayNew extends MovieControllerOverlay {
Rect insets = mWindowInsets;
int pr = insets.right;
int pb = insets.bottom;
-
+ int pt = insets.top;
int h = bottom - top;
int w = right - left;
@@ -72,11 +88,50 @@ public class MovieControllerOverlayNew extends MovieControllerOverlay {
mBackground.layout(0, y - mTimeBar.getPreferredHeight(), w, y);
mScreenModeExt.onLayout(w, pr, y);
+ if (mIsLive && mState != State.ENDED) {
+ if (mLiveImage != null) {
+ mLiveImage.setVisibility(View.VISIBLE);
+ mLiveImage.layout(width - mLiveImage.getWidth() - mLiveMargin, pt + mLiveMargin,
+ width - mLiveMargin, pt + mLiveMargin + mLiveImage.getHeight());
+ }
+ if (isPrepared()) {
+ mPlayPauseReplayView.setVisibility(View.GONE);
- mPlayPauseReplayView.layout(0, y - mTimeBar.getPreferredHeight(),
- mTimeBar.getPreferredHeight(), y);
+ if (mStopBtn != null) {
+ mStopBtn.setVisibility(View.VISIBLE);
+ mStopBtn.layout(0, y - mTimeBar.getPreferredHeight(),
+ mTimeBar.getPreferredHeight(), y);
+ }
+ }
+ } else {
+ mPlayPauseReplayView.setVisibility(View.VISIBLE);
+ if (mLiveImage != null) {
+ mLiveImage.setVisibility(View.GONE);
+ }
+ if (mStopBtn != null) {
+ mStopBtn.setVisibility(View.GONE);
+ }
+ mPlayPauseReplayView.layout(0, y - mTimeBar.getPreferredHeight(),
+ mTimeBar.getPreferredHeight(), y);
+ }
mTimeBar.layout(mTimeBar.getPreferredHeight(), y - mTimeBar.getPreferredHeight(),
width - mScreenModeExt.getAddedRightPadding(), y);
}
+ public void setLive(boolean live) {
+ mIsLive = live;
+ mTimeBar.setClickable(!mIsLive);
+ }
+
+ public IControllerRewindAndForward getControllerRewindAndForwardExt() {
+ return mControllerRewindAndForwardExt;
+ }
+
+ private boolean isPrepared() {
+ if ((mState == State.PLAYING || mState == State.BUFFERING || mState == State.LOADING)) {
+ return true;
+ }
+ return false;
+ }
+
}
diff --git a/src/com/android/gallery3d/app/MoviePlayer.java b/src/com/android/gallery3d/app/MoviePlayer.java
index 0ecc8bf20..1f6401ee5 100755
--- a/src/com/android/gallery3d/app/MoviePlayer.java
+++ b/src/com/android/gallery3d/app/MoviePlayer.java
@@ -121,7 +121,7 @@ public class MoviePlayer implements
private final Bookmarker mBookmarker;
private final Handler mHandler = new Handler();
private final AudioBecomingNoisyReceiver mAudioBecomingNoisyReceiver;
- private final MovieControllerOverlay mController;
+ private final MovieControllerOverlayNew mController;
private long mResumeableTime = Long.MAX_VALUE;
private int mVideoPosition = 0;
@@ -617,6 +617,7 @@ public class MoviePlayer implements
if ("http".equalsIgnoreCase(scheme) || "rtsp".equalsIgnoreCase(scheme)
|| "https".equalsIgnoreCase(scheme)) {
mController.showLoading();
+ mController.setLive(isLiveStreaming());
mOverlayExt.setPlayingInfo(isLiveStreaming());
mHandler.removeCallbacks(mPlayingChecker);
mHandler.postDelayed(mPlayingChecker, 250);
diff --git a/src/com/android/gallery3d/app/TimeBarNew.java b/src/com/android/gallery3d/app/TimeBarNew.java
index 9f57ef692..74a2b5cb6 100644
--- a/src/com/android/gallery3d/app/TimeBarNew.java
+++ b/src/com/android/gallery3d/app/TimeBarNew.java
@@ -30,6 +30,7 @@
package com.android.gallery3d.app;
import android.content.Context;
+import android.view.MotionEvent;
import com.android.gallery3d.R;
@@ -40,6 +41,7 @@ public class TimeBarNew extends TimeBar {
public TimeBarNew(Context context, Listener listener) {
super(context, listener);
mTimeBarHeight = context.getResources().getDimensionPixelSize(R.dimen.timebar_height);
+ this.setClickable(true);
}
@Override
@@ -51,4 +53,12 @@ public class TimeBarNew extends TimeBar {
public void setInfo(String info) {
// Do nothing here, show nothing in timeBar's info.
}
+
+ @Override
+ public boolean dispatchTouchEvent(MotionEvent event) {
+ if (!isClickable()) {
+ return true;
+ }
+ return super.dispatchTouchEvent(event);
+ }
} \ No newline at end of file