Skip to content

Commit

Permalink
Update PlayFragment.java
Browse files Browse the repository at this point in the history
  • Loading branch information
670637080 authored Aug 23, 2023
1 parent 7eebb87 commit 6687096
Showing 1 changed file with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -512,26 +512,14 @@ void playUrl(String url, HashMap<String, String> headers) {
if(autoRetryCount>0 && url.contains(".m3u8")){
url="https://home.jundie.top:666/unBom.php?m3u8="+url;//尝试去bom头再次播放
}
if (url.startsWith("data:application/dash+xml;base64,")) {
PlayerHelper.updateCfg(mVideoView, mVodPlayerCfg, 2);
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);
}

String finalUrl = url;
if (mActivity == null) return;
requireActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
stopParse();
if (mVideoView != null) {
mVideoView.release();

if (finalUrl != null) {
if (url != null) {
try {
int playerType = mVodPlayerCfg.getInt("pl");
if (playerType >= 10) {
Expand All @@ -548,6 +536,16 @@ public void run() {
e.printStackTrace();
}
hideTip();
String finalUrl = url;
if (finalUrl.startsWith("data:application/dash+xml;base64,")) {
PlayerHelper.updateCfg(mVideoView, mVodPlayerCfg, 2);
App.getInstance().setDashData(finalUrl.split("base64,")[1]);
finalUrl = ControlManager.get().getAddress(true) + "dash/proxy.mpd";
} else if (finalUrl.contains(".mpd") || finalUrl.contains("type=mpd")) {
PlayerHelper.updateCfg(mVideoView, mVodPlayerCfg, 2);
} else {
PlayerHelper.updateCfg(mVideoView, mVodPlayerCfg);
}
mVideoView.setProgressKey(progressKey);
if (headers != null) {
mVideoView.setUrl(finalUrl, headers);
Expand Down Expand Up @@ -1776,4 +1774,4 @@ public void onReceivedSslError(XWalkView view, ValueCallback<Boolean> callback,
}
}

}
}

0 comments on commit 6687096

Please sign in to comment.