|
|
|
|
@ -501,14 +501,15 @@ public class PlayActivity extends BaseActivity { |
|
|
|
|
if(autoRetryCount>1 && url.contains(".m3u8")){ |
|
|
|
|
url="http://home.jundie.top:666/unBom.php?m3u8="+url;//尝试去bom头再次播放
|
|
|
|
|
} |
|
|
|
|
final String[] finalUrl = {url}; |
|
|
|
|
final String finalUrl = url; |
|
|
|
|
runOnUiThread(new Runnable() { |
|
|
|
|
@Override |
|
|
|
|
public void run() { |
|
|
|
|
stopParse(); |
|
|
|
|
if (mVideoView != null) { |
|
|
|
|
mVideoView.release(); |
|
|
|
|
if (finalUrl[0] != null) { |
|
|
|
|
if (finalUrl != null) { |
|
|
|
|
String url =finalUrl; |
|
|
|
|
try { |
|
|
|
|
int playerType = mVodPlayerCfg.getInt("pl"); |
|
|
|
|
if (playerType >= 10) { |
|
|
|
|
@ -517,7 +518,7 @@ public class PlayActivity extends BaseActivity { |
|
|
|
|
setTip("调用外部播放器" + PlayerHelper.getPlayerName(playerType) + "进行播放", true, false); |
|
|
|
|
boolean callResult = false; |
|
|
|
|
long progress = getSavedProgress(progressKey); |
|
|
|
|
callResult = PlayerHelper.runExternalPlayer(playerType, PlayActivity.this, finalUrl[0], playTitle, playSubtitle, headers, progress); |
|
|
|
|
callResult = PlayerHelper.runExternalPlayer(playerType, PlayActivity.this, url, playTitle, playSubtitle, headers, progress); |
|
|
|
|
setTip("调用外部播放器" + PlayerHelper.getPlayerName(playerType) + (callResult ? "成功" : "失败"), callResult, !callResult); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
@ -525,20 +526,20 @@ public class PlayActivity extends BaseActivity { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
hideTip(); |
|
|
|
|
if (finalUrl[0].startsWith("data:application/dash+xml;base64,")) { |
|
|
|
|
if (url.startsWith("data:application/dash+xml;base64,")) { |
|
|
|
|
PlayerHelper.updateCfg(mVideoView, mVodPlayerCfg, 2); |
|
|
|
|
App.getInstance().setDashData(finalUrl[0].split("base64,")[1]); |
|
|
|
|
finalUrl[0] = ControlManager.get().getAddress(true) + "dash/proxy.mpd"; |
|
|
|
|
} else if (finalUrl[0].contains(".mpd") || finalUrl[0].contains("type=mpd")) { |
|
|
|
|
App.getInstance().setDashData(url.split("base64,")[1]); |
|
|
|
|
url = ControlManager.get().getAddress(true) + "dash/proxy.mpd"; |
|
|
|
|
} else if (url.contains(".mpd") || url.contains("type=mpd")) { |
|
|
|
|
PlayerHelper.updateCfg(mVideoView, mVodPlayerCfg, 2); |
|
|
|
|
} else { |
|
|
|
|
PlayerHelper.updateCfg(mVideoView, mVodPlayerCfg); |
|
|
|
|
} |
|
|
|
|
mVideoView.setProgressKey(progressKey); |
|
|
|
|
if (headers != null) { |
|
|
|
|
mVideoView.setUrl(finalUrl[0], headers); |
|
|
|
|
mVideoView.setUrl(url, headers); |
|
|
|
|
} else { |
|
|
|
|
mVideoView.setUrl(finalUrl[0]); |
|
|
|
|
mVideoView.setUrl(url); |
|
|
|
|
} |
|
|
|
|
mVideoView.start(); |
|
|
|
|
mController.resetSpeed(); |
|
|
|
|
@ -1157,7 +1158,7 @@ public class PlayActivity extends BaseActivity { |
|
|
|
|
LinkedHashMap<String, HashMap<String, String>> jxs = new LinkedHashMap<>(); |
|
|
|
|
String extendName = ""; |
|
|
|
|
for (ParseBean p : ApiConfig.get().getParseBeanList()) { |
|
|
|
|
HashMap data = new HashMap<String, String>(); |
|
|
|
|
HashMap<String, String> data = new HashMap<String, String>(); |
|
|
|
|
data.put("url", p.getUrl()); |
|
|
|
|
if (p.getUrl().equals(pb.getUrl())) { |
|
|
|
|
extendName = p.getName(); |
|
|
|
|
|