commit
8b77782348
|
@ -169,6 +169,7 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem
|
||||||
pager.setCurrentItem(lastPosition);
|
pager.setCurrentItem(lastPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void onStart() {
|
protected void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
EventDistributor.getInstance().register(contentUpdate);
|
EventDistributor.getInstance().register(contentUpdate);
|
||||||
|
|
|
@ -603,8 +603,9 @@ public class ItemFragment extends Fragment implements OnSwipeGesture {
|
||||||
@Nullable
|
@Nullable
|
||||||
private FeedItem loadInBackground() {
|
private FeedItem loadInBackground() {
|
||||||
FeedItem feedItem = DBReader.getFeedItem(feedItems[feedItemPos]);
|
FeedItem feedItem = DBReader.getFeedItem(feedItems[feedItemPos]);
|
||||||
if (feedItem != null) {
|
Context context = getContext();
|
||||||
Timeline t = new Timeline(getContext(), feedItem);
|
if (feedItem != null && context != null) {
|
||||||
|
Timeline t = new Timeline(context, feedItem);
|
||||||
webviewData = t.processShownotes(false);
|
webviewData = t.processShownotes(false);
|
||||||
}
|
}
|
||||||
return feedItem;
|
return feedItem;
|
||||||
|
|
|
@ -41,6 +41,7 @@ public class PlayerWidgetJobService extends SafeJobIntentService {
|
||||||
|
|
||||||
private PlaybackService playbackService;
|
private PlaybackService playbackService;
|
||||||
private final Object waitForService = new Object();
|
private final Object waitForService = new Object();
|
||||||
|
private final Object waitUsingService = new Object();
|
||||||
|
|
||||||
private static final int JOB_ID = -17001;
|
private static final int JOB_ID = -17001;
|
||||||
|
|
||||||
|
@ -67,7 +68,11 @@ public class PlayerWidgetJobService extends SafeJobIntentService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateViews();
|
synchronized (waitUsingService) {
|
||||||
|
if (playbackService != null) {
|
||||||
|
updateViews();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (playbackService != null) {
|
if (playbackService != null) {
|
||||||
try {
|
try {
|
||||||
|
@ -230,7 +235,9 @@ public class PlayerWidgetJobService extends SafeJobIntentService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onServiceDisconnected(ComponentName name) {
|
public void onServiceDisconnected(ComponentName name) {
|
||||||
playbackService = null;
|
synchronized (waitUsingService) {
|
||||||
|
playbackService = null;
|
||||||
|
}
|
||||||
Log.d(TAG, "Disconnected from service");
|
Log.d(TAG, "Disconnected from service");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -243,7 +243,7 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
|
||||||
callback.onMediaChanged(false);
|
callback.onMediaChanged(false);
|
||||||
if (stream) {
|
if (stream) {
|
||||||
mediaPlayer.setDataSource(media.getStreamUrl());
|
mediaPlayer.setDataSource(media.getStreamUrl());
|
||||||
} else if (new File(media.getLocalMediaUrl()).canRead()) {
|
} else if (media.getLocalMediaUrl() != null && new File(media.getLocalMediaUrl()).canRead()) {
|
||||||
mediaPlayer.setDataSource(media.getLocalMediaUrl());
|
mediaPlayer.setDataSource(media.getLocalMediaUrl());
|
||||||
} else {
|
} else {
|
||||||
throw new IOException("Unable to read local file " + media.getLocalMediaUrl());
|
throw new IOException("Unable to read local file " + media.getLocalMediaUrl());
|
||||||
|
|
Loading…
Reference in New Issue