Videoplayback is now working
This commit is contained in:
parent
1972652cb1
commit
c07bf6691d
@ -69,9 +69,9 @@
|
|||||||
android:label="@string/downloads_label" />
|
android:label="@string/downloads_label" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.AudioplayerActivity"
|
android:name=".activity.AudioplayerActivity"
|
||||||
android:configChanges="orientation"
|
android:configChanges="keyboardHidden|orientation"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:theme="@style/Theme.MediaPlayer" />
|
android:theme="@style/Theme.MediaPlayer" android:screenOrientation="portrait"/>
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name="de.danoeh.antennapod.service.DownloadService"
|
android:name="de.danoeh.antennapod.service.DownloadService"
|
||||||
@ -197,6 +197,7 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".activity.MiroGuideCategoryActivity" android:configChanges="keyboardHidden|orientation" android:theme="@style/StyledIndicators"></activity>
|
<activity android:name=".activity.MiroGuideCategoryActivity" android:configChanges="keyboardHidden|orientation" android:theme="@style/StyledIndicators"></activity>
|
||||||
<activity android:name=".activity.MiroGuideChannelViewActivity" android:configChanges="keyboard|orientation" android:label="@string/miro_guide_label"></activity>
|
<activity android:name=".activity.MiroGuideChannelViewActivity" android:configChanges="keyboard|orientation" android:label="@string/miro_guide_label"></activity>
|
||||||
|
<activity android:name=".activity.VideoplayerActivity" android:configChanges="keyboardHidden|orientation" android:screenOrientation="landscape" android:theme="@style/VideoplayerTheme"></activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
@ -10,4 +10,9 @@
|
|||||||
<item name="android:textColor">@color/black</item>
|
<item name="android:textColor">@color/black</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
<style name="VideoplayerTheme" parent="@style/Theme.Sherlock.Light.ForceOverflow">
|
||||||
|
<item name="android:windowActionBarOverlay">true</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
@ -1,5 +1,6 @@
|
|||||||
package de.danoeh.antennapod.activity;
|
package de.danoeh.antennapod.activity;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.app.FragmentManager;
|
import android.support.v4.app.FragmentManager;
|
||||||
import android.support.v4.app.FragmentStatePagerAdapter;
|
import android.support.v4.app.FragmentStatePagerAdapter;
|
||||||
@ -22,7 +23,6 @@ public class AudioplayerActivity extends MediaplayerActivity {
|
|||||||
|
|
||||||
final String TAG = "AudioplayerActivity";
|
final String TAG = "AudioplayerActivity";
|
||||||
|
|
||||||
// Widgets
|
|
||||||
private CoverFragment coverFragment;
|
private CoverFragment coverFragment;
|
||||||
private ItemDescriptionFragment descriptionFragment;
|
private ItemDescriptionFragment descriptionFragment;
|
||||||
ViewPager viewpager;
|
ViewPager viewpager;
|
||||||
@ -32,8 +32,7 @@ public class AudioplayerActivity extends MediaplayerActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onAwaitingVideoSurface() {
|
protected void onAwaitingVideoSurface() {
|
||||||
// TODO Auto-generated method stub
|
startActivity(new Intent(this, VideoplayerActivity.class));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -24,6 +24,7 @@ import de.danoeh.antennapod.fragment.FeedlistFragment;
|
|||||||
import de.danoeh.antennapod.fragment.QueueFragment;
|
import de.danoeh.antennapod.fragment.QueueFragment;
|
||||||
import de.danoeh.antennapod.fragment.UnreadItemlistFragment;
|
import de.danoeh.antennapod.fragment.UnreadItemlistFragment;
|
||||||
import de.danoeh.antennapod.service.DownloadService;
|
import de.danoeh.antennapod.service.DownloadService;
|
||||||
|
import de.danoeh.antennapod.service.PlaybackService;
|
||||||
import de.danoeh.antennapod.storage.DownloadRequester;
|
import de.danoeh.antennapod.storage.DownloadRequester;
|
||||||
import de.danoeh.antennapod.util.StorageUtils;
|
import de.danoeh.antennapod.util.StorageUtils;
|
||||||
import de.danoeh.antennapod.AppConfig;
|
import de.danoeh.antennapod.AppConfig;
|
||||||
@ -104,7 +105,7 @@ public class MainActivity extends SherlockFragmentActivity {
|
|||||||
startActivity(new Intent(this, PreferenceActivity.class));
|
startActivity(new Intent(this, PreferenceActivity.class));
|
||||||
return true;
|
return true;
|
||||||
case R.id.show_player:
|
case R.id.show_player:
|
||||||
startActivity(new Intent(this, AudioplayerActivity.class));
|
startActivity(PlaybackService.getPlayerActivityIntent(this));
|
||||||
return true;
|
return true;
|
||||||
case R.id.opml_import:
|
case R.id.opml_import:
|
||||||
startActivity(new Intent(this, OpmlImportActivity.class));
|
startActivity(new Intent(this, OpmlImportActivity.class));
|
||||||
|
@ -377,9 +377,9 @@ public abstract class MediaplayerActivity extends SherlockFragmentActivity {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void onAwaitingVideoSurface();
|
protected abstract void onAwaitingVideoSurface();
|
||||||
|
|
||||||
protected abstract void postStatusMsg(int resId);
|
protected abstract void postStatusMsg(int resId);
|
||||||
|
|
||||||
protected abstract void clearStatusMsg();
|
protected abstract void clearStatusMsg();
|
||||||
@ -543,30 +543,13 @@ public abstract class MediaplayerActivity extends SherlockFragmentActivity {
|
|||||||
if (AppConfig.DEBUG)
|
if (AppConfig.DEBUG)
|
||||||
Log.d(TAG, "Querying service info");
|
Log.d(TAG, "Querying service info");
|
||||||
if (playbackService != null) {
|
if (playbackService != null) {
|
||||||
int requestedOrientation;
|
|
||||||
status = playbackService.getStatus();
|
status = playbackService.getStatus();
|
||||||
media = playbackService.getMedia();
|
media = playbackService.getMedia();
|
||||||
invalidateOptionsMenu();
|
invalidateOptionsMenu();
|
||||||
|
|
||||||
if (playbackService.isPlayingVideo()) {
|
setupGUI();
|
||||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
handleStatus();
|
||||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
|
|
||||||
} else {
|
|
||||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
|
||||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
|
|
||||||
}
|
|
||||||
// check if orientation is correct
|
|
||||||
if ((requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE && orientation == Configuration.ORIENTATION_LANDSCAPE)
|
|
||||||
|| (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT && orientation == Configuration.ORIENTATION_PORTRAIT)) {
|
|
||||||
if (AppConfig.DEBUG)
|
|
||||||
Log.d(TAG, "Orientation correct");
|
|
||||||
setupGUI();
|
|
||||||
handleStatus();
|
|
||||||
} else {
|
|
||||||
if (AppConfig.DEBUG)
|
|
||||||
Log.d(TAG,
|
|
||||||
"Orientation incorrect, waiting for orientation change");
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Log.e(TAG,
|
Log.e(TAG,
|
||||||
"queryService() was called without an existing connection to playbackservice");
|
"queryService() was called without an existing connection to playbackservice");
|
||||||
|
@ -6,10 +6,12 @@ import de.danoeh.antennapod.service.PlaybackService;
|
|||||||
import de.danoeh.antennapod.service.PlayerStatus;
|
import de.danoeh.antennapod.service.PlayerStatus;
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.SurfaceHolder;
|
import android.view.SurfaceHolder;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.Window;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.VideoView;
|
import android.widget.VideoView;
|
||||||
@ -20,16 +22,22 @@ public class VideoplayerActivity extends MediaplayerActivity implements
|
|||||||
|
|
||||||
/** True if video controls are currently visible. */
|
/** True if video controls are currently visible. */
|
||||||
private boolean videoControlsShowing = true;
|
private boolean videoControlsShowing = true;
|
||||||
|
private boolean videoSurfaceCreated = false;
|
||||||
private VideoControlsHider videoControlsToggler;
|
private VideoControlsHider videoControlsToggler;
|
||||||
|
|
||||||
private LinearLayout videoOverlay;
|
private LinearLayout videoOverlay;
|
||||||
private VideoView videoview;
|
private VideoView videoview;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
if (PlaybackService.isRunning && playbackService != null
|
if (PlaybackService.isRunning && playbackService != null
|
||||||
&& playbackService.isPlayingVideo()) {
|
&& PlaybackService.isPlayingVideo()) {
|
||||||
playbackService.stop();
|
playbackService.stop();
|
||||||
}
|
}
|
||||||
if (videoControlsToggler != null) {
|
if (videoControlsToggler != null) {
|
||||||
@ -38,8 +46,6 @@ public class VideoplayerActivity extends MediaplayerActivity implements
|
|||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setupGUI() {
|
protected void setupGUI() {
|
||||||
super.setupGUI();
|
super.setupGUI();
|
||||||
@ -53,11 +59,14 @@ public class VideoplayerActivity extends MediaplayerActivity implements
|
|||||||
WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onAwaitingVideoSurface() {
|
protected void onAwaitingVideoSurface() {
|
||||||
playbackService.setVideoSurface(videoview.getHolder());
|
if (videoSurfaceCreated) {
|
||||||
|
if (AppConfig.DEBUG)
|
||||||
|
Log.d(TAG,
|
||||||
|
"Videosurface already created, setting videosurface now");
|
||||||
|
playbackService.setVideoSurface(videoview.getHolder());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -71,7 +80,7 @@ public class VideoplayerActivity extends MediaplayerActivity implements
|
|||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
View.OnTouchListener onVideoviewTouched = new View.OnTouchListener() {
|
View.OnTouchListener onVideoviewTouched = new View.OnTouchListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -117,33 +126,6 @@ public class VideoplayerActivity extends MediaplayerActivity implements
|
|||||||
videoControlsShowing = !videoControlsShowing;
|
videoControlsShowing = !videoControlsShowing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void surfaceChanged(SurfaceHolder holder, int format, int width,
|
|
||||||
int height) {
|
|
||||||
holder.setFixedSize(width, height);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void surfaceCreated(SurfaceHolder holder) {
|
|
||||||
if (AppConfig.DEBUG)
|
|
||||||
Log.d(TAG, "Videoview holder created");
|
|
||||||
if (status == PlayerStatus.AWAITING_VIDEO_SURFACE) {
|
|
||||||
if (playbackService != null) {
|
|
||||||
playbackService.setVideoSurface(holder);
|
|
||||||
} else {
|
|
||||||
Log.e(TAG,
|
|
||||||
"Could'nt attach surface to mediaplayer - reference to service was null");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void surfaceDestroyed(SurfaceHolder holder) {
|
|
||||||
if (AppConfig.DEBUG) Log.d(TAG, "Videosurface was destroyed");
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Hides the videocontrols after a certain period of time. */
|
/** Hides the videocontrols after a certain period of time. */
|
||||||
public class VideoControlsHider extends AsyncTask<Void, Void, Void> {
|
public class VideoControlsHider extends AsyncTask<Void, Void, Void> {
|
||||||
@Override
|
@Override
|
||||||
@ -183,4 +165,33 @@ public class VideoplayerActivity extends MediaplayerActivity implements
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void surfaceChanged(SurfaceHolder holder, int format, int width,
|
||||||
|
int height) {
|
||||||
|
holder.setFixedSize(width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void surfaceCreated(SurfaceHolder holder) {
|
||||||
|
if (AppConfig.DEBUG)
|
||||||
|
Log.d(TAG, "Videoview holder created");
|
||||||
|
videoSurfaceCreated = true;
|
||||||
|
if (status == PlayerStatus.AWAITING_VIDEO_SURFACE) {
|
||||||
|
if (playbackService != null) {
|
||||||
|
playbackService.setVideoSurface(holder);
|
||||||
|
} else {
|
||||||
|
Log.e(TAG,
|
||||||
|
"Could'nt attach surface to mediaplayer - reference to service was null");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void surfaceDestroyed(SurfaceHolder holder) {
|
||||||
|
if (AppConfig.DEBUG)
|
||||||
|
Log.d(TAG, "Videosurface was destroyed");
|
||||||
|
videoSurfaceCreated = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -106,8 +106,7 @@ public class FeedManager {
|
|||||||
context.startService(launchIntent);
|
context.startService(launchIntent);
|
||||||
if (showPlayer) {
|
if (showPlayer) {
|
||||||
// Launch Mediaplayer
|
// Launch Mediaplayer
|
||||||
Intent playerIntent = new Intent(context, AudioplayerActivity.class);
|
context.startActivity(PlaybackService.getPlayerActivityIntent(context, media));
|
||||||
context.startActivity(playerIntent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ import de.danoeh.antennapod.AppConfig;
|
|||||||
import de.danoeh.antennapod.PodcastApp;
|
import de.danoeh.antennapod.PodcastApp;
|
||||||
import de.danoeh.antennapod.R;
|
import de.danoeh.antennapod.R;
|
||||||
import de.danoeh.antennapod.activity.AudioplayerActivity;
|
import de.danoeh.antennapod.activity.AudioplayerActivity;
|
||||||
|
import de.danoeh.antennapod.activity.VideoplayerActivity;
|
||||||
import de.danoeh.antennapod.feed.Feed;
|
import de.danoeh.antennapod.feed.Feed;
|
||||||
import de.danoeh.antennapod.feed.FeedItem;
|
import de.danoeh.antennapod.feed.FeedItem;
|
||||||
import de.danoeh.antennapod.feed.FeedManager;
|
import de.danoeh.antennapod.feed.FeedManager;
|
||||||
@ -47,6 +48,8 @@ public class PlaybackService extends Service {
|
|||||||
public static final String PREF_LAST_PLAYED_FEED_ID = "de.danoeh.antennapod.preferences.lastPlayedFeedId";
|
public static final String PREF_LAST_PLAYED_FEED_ID = "de.danoeh.antennapod.preferences.lastPlayedFeedId";
|
||||||
/** True if last played media was streamed. */
|
/** True if last played media was streamed. */
|
||||||
public static final String PREF_LAST_IS_STREAM = "de.danoeh.antennapod.preferences.lastIsStream";
|
public static final String PREF_LAST_IS_STREAM = "de.danoeh.antennapod.preferences.lastIsStream";
|
||||||
|
/** True if last played media was a video. */
|
||||||
|
public static final String PREF_LAST_IS_VIDEO = "de.danoeh.antennapod.preferences.lastIsVideo";
|
||||||
|
|
||||||
/** Contains the id of the FeedMedia object. */
|
/** Contains the id of the FeedMedia object. */
|
||||||
public static final String EXTRA_MEDIA_ID = "extra.de.danoeh.antennapod.service.mediaId";
|
public static final String EXTRA_MEDIA_ID = "extra.de.danoeh.antennapod.service.mediaId";
|
||||||
@ -91,7 +94,6 @@ public class PlaybackService extends Service {
|
|||||||
/** True if media should be streamed (Extracted from Intent Extra) . */
|
/** True if media should be streamed (Extracted from Intent Extra) . */
|
||||||
private boolean shouldStream;
|
private boolean shouldStream;
|
||||||
private boolean startWhenPrepared;
|
private boolean startWhenPrepared;
|
||||||
private boolean playingVideo;
|
|
||||||
private FeedManager manager;
|
private FeedManager manager;
|
||||||
private PlayerStatus status;
|
private PlayerStatus status;
|
||||||
private PositionSaver positionSaver;
|
private PositionSaver positionSaver;
|
||||||
@ -99,6 +101,8 @@ public class PlaybackService extends Service {
|
|||||||
|
|
||||||
private volatile PlayerStatus statusBeforeSeek;
|
private volatile PlayerStatus statusBeforeSeek;
|
||||||
|
|
||||||
|
private static boolean playingVideo;
|
||||||
|
|
||||||
/** True if mediaplayer was paused because it lost audio focus temporarily */
|
/** True if mediaplayer was paused because it lost audio focus temporarily */
|
||||||
private boolean pausedBecauseOfTransientAudiofocusLoss;
|
private boolean pausedBecauseOfTransientAudiofocusLoss;
|
||||||
|
|
||||||
@ -110,6 +114,43 @@ public class PlaybackService extends Service {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an intent which starts an audio- or videoplayer, depending on the
|
||||||
|
* type of media that is being played. If the playbackservice is not
|
||||||
|
* running, the type of the last played media will be looked up.
|
||||||
|
* */
|
||||||
|
public static Intent getPlayerActivityIntent(Context context) {
|
||||||
|
if (isRunning) {
|
||||||
|
if (playingVideo) {
|
||||||
|
return new Intent(context, VideoplayerActivity.class);
|
||||||
|
} else {
|
||||||
|
return new Intent(context, AudioplayerActivity.class);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
SharedPreferences pref = context.getApplicationContext()
|
||||||
|
.getSharedPreferences(PodcastApp.PREF_NAME, 0);
|
||||||
|
boolean isVideo = pref.getBoolean(PREF_LAST_IS_VIDEO, false);
|
||||||
|
if (isVideo) {
|
||||||
|
return new Intent(context, VideoplayerActivity.class);
|
||||||
|
} else {
|
||||||
|
return new Intent(context, AudioplayerActivity.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Same as getPlayerActivityIntent(context), but here the type of activity
|
||||||
|
* depends on the FeedMedia that is provided as an argument.
|
||||||
|
*/
|
||||||
|
public static Intent getPlayerActivityIntent(Context context,
|
||||||
|
FeedMedia media) {
|
||||||
|
if (media.getMime_type().startsWith("video")) {
|
||||||
|
return new Intent(context, VideoplayerActivity.class);
|
||||||
|
} else {
|
||||||
|
return new Intent(context, AudioplayerActivity.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
@ -529,6 +570,7 @@ public class PlaybackService extends Service {
|
|||||||
editor.putLong(PREF_LAST_PLAYED_ID, media.getId());
|
editor.putLong(PREF_LAST_PLAYED_ID, media.getId());
|
||||||
editor.putLong(PREF_LAST_PLAYED_FEED_ID, feed.getId());
|
editor.putLong(PREF_LAST_PLAYED_FEED_ID, feed.getId());
|
||||||
editor.putBoolean(PREF_LAST_IS_STREAM, shouldStream);
|
editor.putBoolean(PREF_LAST_IS_STREAM, shouldStream);
|
||||||
|
editor.putBoolean(PREF_LAST_IS_VIDEO, playingVideo);
|
||||||
editor.commit();
|
editor.commit();
|
||||||
|
|
||||||
player.start();
|
player.start();
|
||||||
@ -562,8 +604,8 @@ public class PlaybackService extends Service {
|
|||||||
|
|
||||||
/** Prepares notification and starts the service in the foreground. */
|
/** Prepares notification and starts the service in the foreground. */
|
||||||
private void setupNotification() {
|
private void setupNotification() {
|
||||||
PendingIntent pIntent = PendingIntent.getActivity(this, 0, new Intent(
|
PendingIntent pIntent = PendingIntent.getActivity(this, 0,
|
||||||
this, AudioplayerActivity.class),
|
PlaybackService.getPlayerActivityIntent(this),
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT);
|
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
|
|
||||||
Bitmap icon = BitmapFactory.decodeResource(null,
|
Bitmap icon = BitmapFactory.decodeResource(null,
|
||||||
@ -809,7 +851,7 @@ public class PlaybackService extends Service {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPlayingVideo() {
|
public static boolean isPlayingVideo() {
|
||||||
return playingVideo;
|
return playingVideo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ public class PlayerWidgetService extends Service {
|
|||||||
RemoteViews views = new RemoteViews(getPackageName(),
|
RemoteViews views = new RemoteViews(getPackageName(),
|
||||||
R.layout.player_widget);
|
R.layout.player_widget);
|
||||||
PendingIntent startMediaplayer = PendingIntent.getActivity(this, 0,
|
PendingIntent startMediaplayer = PendingIntent.getActivity(this, 0,
|
||||||
new Intent(this, AudioplayerActivity.class), 0);
|
PlaybackService.getPlayerActivityIntent(this), 0);
|
||||||
|
|
||||||
views.setOnClickPendingIntent(R.id.layout_left, startMediaplayer);
|
views.setOnClickPendingIntent(R.id.layout_left, startMediaplayer);
|
||||||
if (playbackService != null) {
|
if (playbackService != null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user