Skip to content

Commit

Permalink
update debug
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfeng committed Sep 1, 2020
1 parent d55b742 commit 651f631
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
3 changes: 2 additions & 1 deletion debug/src/main/java/snow/player/debug/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ private Playlist createPlaylist() {
.setIconUri("http://p2.music.126.net/0543F-ln2Apdiopez_jbsA==/109951163244853571.jpg")
.build();

MusicItem song4 = new MusicItemBuilder(265000, "http://music.163.com/song/media/outer/url?id=25638340")
// cross-protocol redirects
MusicItem song4 = new MusicItemBuilder(265000, "https://music.163.com/song/media/outer/url?id=25638340")
.setTitle("此生不换")
.setArtist("青鸟飞鱼")
.setIconUri("http://p2.music.126.net/UyDVlWWgOn8p8U8uQ_I1xQ==/7934075907687518.jpg")
Expand Down
17 changes: 14 additions & 3 deletions debug/src/main/java/snow/player/debug/MyFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import com.google.android.exoplayer2.source.ProgressiveMediaSource;
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource;
import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory;
import com.google.android.exoplayer2.util.Util;

import snow.player.HistoryRecorder;
Expand All @@ -22,9 +24,18 @@ public class MyFactory extends PlayerService.ComponentFactory {

@Override
public void init(Context context) {
mMediaSourceFactory = new ProgressiveMediaSource.Factory(new DefaultDataSourceFactory(
context,
Util.getUserAgent(context, context.getPackageName())));
DefaultHttpDataSourceFactory httpDataSourceFactory =
new DefaultHttpDataSourceFactory(
Util.getUserAgent(context, context.getPackageName()),
null,
DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS,
DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS,
true);

DefaultDataSourceFactory dataSourceFactory = new DefaultDataSourceFactory(
context, httpDataSourceFactory);

mMediaSourceFactory = new ProgressiveMediaSource.Factory(dataSourceFactory);
}

@Inject
Expand Down

0 comments on commit 651f631

Please sign in to comment.