|
|
|
|
@ -1,5 +1,6 @@ |
|
|
|
|
package com.fongmi.android.tv.player.danmaku; |
|
|
|
|
|
|
|
|
|
import com.fongmi.android.tv.Constant; |
|
|
|
|
import com.fongmi.android.tv.bean.Danmaku; |
|
|
|
|
import com.fongmi.android.tv.utils.UrlUtil; |
|
|
|
|
import com.github.catvod.net.OkHttp; |
|
|
|
|
@ -13,8 +14,6 @@ import master.flame.danmaku.danmaku.parser.android.AndroidFileSource; |
|
|
|
|
|
|
|
|
|
public class Loader implements ILoader { |
|
|
|
|
|
|
|
|
|
private static final int TIMEOUT = 30 * 1000; |
|
|
|
|
|
|
|
|
|
private AndroidFileSource dataSource; |
|
|
|
|
|
|
|
|
|
public Loader(Danmaku item) { |
|
|
|
|
@ -29,7 +28,7 @@ public class Loader implements ILoader { |
|
|
|
|
public void load(String url) throws IllegalDataException { |
|
|
|
|
try { |
|
|
|
|
OkHttp.cancel("danmaku"); |
|
|
|
|
load(OkHttp.newCall(OkHttp.client(TIMEOUT), UrlUtil.convert(url), "danmaku").execute().body().byteStream()); |
|
|
|
|
load(OkHttp.newCall(OkHttp.client(Constant.TIMEOUT_DANMAKU), UrlUtil.convert(url), "danmaku").execute().body().byteStream()); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|