made frontend combatible to latest extractor refactorings
This commit is contained in:
parent
1910e81ad9
commit
96a327af17
27 changed files with 141 additions and 130 deletions
|
|
@ -407,10 +407,10 @@ public final class BackgroundPlayer extends Service {
|
|||
final MediaSource liveSource = super.sourceOf(item, info);
|
||||
if (liveSource != null) return liveSource;
|
||||
|
||||
final int index = ListHelper.getDefaultAudioFormat(context, info.audio_streams);
|
||||
if (index < 0 || index >= info.audio_streams.size()) return null;
|
||||
final int index = ListHelper.getDefaultAudioFormat(context, info.getAudioStreams());
|
||||
if (index < 0 || index >= info.getAudioStreams().size()) return null;
|
||||
|
||||
final AudioStream audio = info.audio_streams.get(index);
|
||||
final AudioStream audio = info.getAudioStreams().get(index);
|
||||
return buildMediaSource(audio.getUrl(), PlayerHelper.cacheKeyOf(info, audio),
|
||||
MediaFormat.getSuffixById(audio.getFormatId()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -833,7 +833,7 @@ public abstract class BasePlayer implements
|
|||
|
||||
// on metadata changed
|
||||
} else if (currentPlaylistIndex != currentPlayQueueIndex || !isPlaying()) {
|
||||
final long startPos = info != null ? info.start_position : C.TIME_UNSET;
|
||||
final long startPos = info != null ? info.getStartPosition() : C.TIME_UNSET;
|
||||
if (DEBUG) Log.d(TAG, "Rewinding to correct" +
|
||||
" window=[" + currentPlayQueueIndex + "]," +
|
||||
" at=[" + getTimeString((int)startPos) + "]," +
|
||||
|
|
@ -950,7 +950,7 @@ public abstract class BasePlayer implements
|
|||
/* If current playback has run for PLAY_PREV_ACTIVATION_LIMIT milliseconds, restart current track.
|
||||
* Also restart the track if the current track is the first in a queue.*/
|
||||
if (simpleExoPlayer.getCurrentPosition() > PLAY_PREV_ACTIVATION_LIMIT || playQueue.getIndex() == 0) {
|
||||
final long startPos = currentInfo == null ? 0 : currentInfo.start_position;
|
||||
final long startPos = currentInfo == null ? 0 : currentInfo.getStartPosition();
|
||||
simpleExoPlayer.seekTo(startPos);
|
||||
} else {
|
||||
playQueue.offsetIndex(-1);
|
||||
|
|
|
|||
|
|
@ -579,7 +579,7 @@ public abstract class ServicePlayerActivity extends AppCompatActivity
|
|||
public void onMetadataUpdate(StreamInfo info) {
|
||||
if (info != null) {
|
||||
metadataTitle.setText(info.getName());
|
||||
metadataArtist.setText(info.uploader_name);
|
||||
metadataArtist.setText(info.getUploaderName());
|
||||
|
||||
progressEndTime.setVisibility(View.GONE);
|
||||
progressLiveSync.setVisibility(View.GONE);
|
||||
|
|
|
|||
|
|
@ -354,10 +354,10 @@ public abstract class VideoPlayer extends BasePlayer
|
|||
break;
|
||||
|
||||
case VIDEO_STREAM:
|
||||
if (info.video_streams.size() + info.video_only_streams.size() == 0) break;
|
||||
if (info.getVideoStreams().size() + info.getVideoOnlyStreams().size() == 0) break;
|
||||
|
||||
final List<VideoStream> videos = ListHelper.getSortedStreamVideosList(context,
|
||||
info.video_streams, info.video_only_streams, false);
|
||||
info.getVideoStreams(), info.getVideoOnlyStreams(), false);
|
||||
availableStreams = new ArrayList<>(videos);
|
||||
if (playbackQuality == null) {
|
||||
selectedStreamIndex = getDefaultResolutionIndex(videos);
|
||||
|
|
@ -388,7 +388,7 @@ public abstract class VideoPlayer extends BasePlayer
|
|||
|
||||
// Create video stream source
|
||||
final List<VideoStream> videos = ListHelper.getSortedStreamVideosList(context,
|
||||
info.video_streams, info.video_only_streams, false);
|
||||
info.getVideoStreams(), info.getVideoOnlyStreams(), false);
|
||||
final int index;
|
||||
if (videos.isEmpty()) {
|
||||
index = -1;
|
||||
|
|
|
|||
|
|
@ -417,9 +417,9 @@ public class MediaSourceManager {
|
|||
final Exception exception = new IllegalStateException(
|
||||
"Unable to resolve source from stream info." +
|
||||
" URL: " + stream.getUrl() +
|
||||
", audio count: " + streamInfo.audio_streams.size() +
|
||||
", video count: " + streamInfo.video_only_streams.size() +
|
||||
streamInfo.video_streams.size());
|
||||
", audio count: " + streamInfo.getAudioStreams().size() +
|
||||
", video count: " + streamInfo.getVideoOnlyStreams().size() +
|
||||
streamInfo.getVideoStreams().size());
|
||||
return new FailedMediaSource(stream, exception);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue