Minor improvements to Mediaplayer
This commit is contained in:
parent
68385f848f
commit
12e957b6df
|
@ -153,8 +153,8 @@ public class MediaplayerActivity extends SherlockActivity {
|
||||||
if (media != null) {
|
if (media != null) {
|
||||||
MediaPlayer player = playbackService.getPlayer();
|
MediaPlayer player = playbackService.getPlayer();
|
||||||
|
|
||||||
getSupportActionBar().setTitle(media.getItem().getTitle());
|
getSupportActionBar().setSubtitle(media.getItem().getTitle());
|
||||||
getSupportActionBar().setSubtitle(
|
getSupportActionBar().setTitle(
|
||||||
media.getItem().getFeed().getTitle());
|
media.getItem().getFeed().getTitle());
|
||||||
|
|
||||||
imgvCover.setImageBitmap(
|
imgvCover.setImageBitmap(
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class FeedMedia extends FeedFile{
|
||||||
this.download_url = download_url;
|
this.download_url = download_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getDuration() {
|
public int getDuration() {
|
||||||
return duration;
|
return duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ public class FeedMedia extends FeedFile{
|
||||||
this.duration = duration;
|
this.duration = duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getPosition() {
|
public int getPosition() {
|
||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,6 +129,7 @@ public class PlaybackService extends Service {
|
||||||
if (status == PlayerStatus.PAUSED || status == PlayerStatus.PREPARED) {
|
if (status == PlayerStatus.PAUSED || status == PlayerStatus.PREPARED) {
|
||||||
Log.d(TAG, "Resuming/Starting playback");
|
Log.d(TAG, "Resuming/Starting playback");
|
||||||
player.start();
|
player.start();
|
||||||
|
player.seekTo((int) media.getPosition());
|
||||||
setStatus(PlayerStatus.PLAYING);
|
setStatus(PlayerStatus.PLAYING);
|
||||||
setupPositionSaver();
|
setupPositionSaver();
|
||||||
} else if (status == PlayerStatus.STOPPED) {
|
} else if (status == PlayerStatus.STOPPED) {
|
||||||
|
|
Loading…
Reference in New Issue