Skip to content

Commit

Permalink
fix #3047
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuo committed Nov 23, 2020
1 parent 29ced8b commit d5e9529
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ private String getUrl() {
//String url = "http://yongtaizx.xyz/20191230/t2Axgh3k/index.m3u8";
//String url = "http://123.56.109.212:8035/users/bfe52074fba74247853caa764b522731/films/orig/aa4c3451-0468-452a-a189-bd064a1963e5-鹿鼎记下.mp4";
//String url = "http://static.hnyequ.cn/yequ_iOS/4940735da1227890e6a261937223e0d2_828x1472.mp4";
String url = "https://tx.hls.huya.com/src/78941969-2579769454-11080025436149776384-3144993630-10057-A-0-1-imgplus_2000.m3u8?wsSecret=3e6b5903368d02d0c591a57a07940cca&wsTime=5f4ca52f&u=0&seqid=15987721445850596&ctype=tars_mobile&fs=bgct&sphdcdn=al_7-tx_3-js_3-ws_7-bd_2-hw_2&sphdDC=huya&sphd=264_*&t=103";
String url = "http://39.104.119.42/elevator-1.0/api/downFile?path=demo.ogv";
//String url = "http://pointshow.oss-cn-hangzhou.aliyuncs.com/transcode/ORIGINAL/Mnbc61586842828593.mp4";
//ssl error
//String url = "https://file.shftz.cn:8443/filesystem/download/10/2019/3/26/ce2c7c66-e9eb-42be-adf6-f9008385ea8c.mov/play";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.DefaultLoadControl;
import com.google.android.exoplayer2.DefaultRenderersFactory;
import com.google.android.exoplayer2.ExoPlayerFactory;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.source.ConcatenatingMediaSource;
import com.google.android.exoplayer2.source.MediaSource;
Expand Down Expand Up @@ -134,7 +134,11 @@ public void run() {
if (mLoadControl == null) {
mLoadControl = new DefaultLoadControl();
}
mInternalPlayer = ExoPlayerFactory.newSimpleInstance(mAppContext, mRendererFactory, mTrackSelector, mLoadControl, null, Looper.getMainLooper());
mInternalPlayer = new SimpleExoPlayer.Builder(mAppContext, mRendererFactory)
.setLooper(Looper.getMainLooper())
.setTrackSelector(mTrackSelector)
.setLoadControl(mLoadControl).build();

mInternalPlayer.addListener(GSYExo2MediaPlayer.this);
mInternalPlayer.addAnalyticsListener(GSYExo2MediaPlayer.this);
mInternalPlayer.addListener(mEventLogger);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.DefaultLoadControl;
import com.google.android.exoplayer2.DefaultRenderersFactory;
import com.google.android.exoplayer2.ExoPlayerFactory;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.source.MediaSource;
import com.google.android.exoplayer2.source.MergingMediaSource;
import com.google.android.exoplayer2.source.SingleSampleMediaSource;
Expand Down Expand Up @@ -58,7 +58,10 @@ public void run() {
if (mLoadControl == null) {
mLoadControl = new DefaultLoadControl();
}
mInternalPlayer = ExoPlayerFactory.newSimpleInstance(mAppContext, mRendererFactory, mTrackSelector, mLoadControl, null, Looper.getMainLooper());
mInternalPlayer = new SimpleExoPlayer.Builder(mAppContext, mRendererFactory)
.setLooper(Looper.getMainLooper())
.setTrackSelector(mTrackSelector)
.setLoadControl(mLoadControl).build();
mInternalPlayer.addListener(GSYExoSubTitlePlayer.this);
mInternalPlayer.addAnalyticsListener(GSYExoSubTitlePlayer.this);
if (mTextOutput != null) {
Expand Down

0 comments on commit d5e9529

Please sign in to comment.