|
|
|
|
@ -10,6 +10,7 @@ import android.widget.ImageView; |
|
|
|
|
import android.widget.LinearLayout; |
|
|
|
|
import android.widget.SeekBar; |
|
|
|
|
import android.widget.TextView; |
|
|
|
|
import android.widget.Toast; |
|
|
|
|
|
|
|
|
|
import androidx.annotation.NonNull; |
|
|
|
|
import androidx.recyclerview.widget.DiffUtil; |
|
|
|
|
@ -19,6 +20,9 @@ import com.github.tvbox.osc.R; |
|
|
|
|
import com.github.tvbox.osc.api.ApiConfig; |
|
|
|
|
import com.github.tvbox.osc.bean.IJKCode; |
|
|
|
|
import com.github.tvbox.osc.bean.ParseBean; |
|
|
|
|
import com.github.tvbox.osc.player.thirdparty.Kodi; |
|
|
|
|
import com.github.tvbox.osc.player.thirdparty.MXPlayer; |
|
|
|
|
import com.github.tvbox.osc.player.thirdparty.ReexPlayer; |
|
|
|
|
import com.github.tvbox.osc.subtitle.widget.SimpleSubtitleView; |
|
|
|
|
import com.github.tvbox.osc.ui.adapter.ParseAdapter; |
|
|
|
|
import com.github.tvbox.osc.ui.adapter.SelectDialogAdapter; |
|
|
|
|
@ -340,6 +344,41 @@ public class VodController extends BaseController { |
|
|
|
|
@Override |
|
|
|
|
public void onClick(View view) { |
|
|
|
|
// myHandle.removeCallbacks(myRunnable);
|
|
|
|
|
// myHandle.postDelayed(myRunnable, myHandleSeconds);
|
|
|
|
|
try { |
|
|
|
|
int playerType = mPlayerConfig.getInt("pl"); |
|
|
|
|
boolean playerVail = false; |
|
|
|
|
do { |
|
|
|
|
playerType++; |
|
|
|
|
if (playerType <= 2) { |
|
|
|
|
playerVail = true; |
|
|
|
|
} else if (playerType == 10) { |
|
|
|
|
playerVail = MXPlayer.getPackageInfo() != null; |
|
|
|
|
} else if (playerType == 11) { |
|
|
|
|
playerVail = ReexPlayer.getPackageInfo() != null; |
|
|
|
|
} else if (playerType == 12) { |
|
|
|
|
playerVail = Kodi.getPackageInfo() != null; |
|
|
|
|
} else if (playerType > 11) { |
|
|
|
|
playerType = 0; |
|
|
|
|
playerVail = true; |
|
|
|
|
} |
|
|
|
|
} while (!playerVail); |
|
|
|
|
mPlayerConfig.put("pl", playerType); |
|
|
|
|
updatePlayerCfgView(); |
|
|
|
|
listener.updatePlayerCfg(); |
|
|
|
|
listener.replay(false); |
|
|
|
|
// hideBottom();
|
|
|
|
|
} catch (JSONException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
mPlayerBtn.requestFocus(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
mPlayerBtn.setOnLongClickListener(new OnLongClickListener() { |
|
|
|
|
@Override |
|
|
|
|
public boolean onLongClick(View view) { |
|
|
|
|
// myHandle.removeCallbacks(myRunnable);
|
|
|
|
|
// myHandle.postDelayed(myRunnable, myHandleSeconds);
|
|
|
|
|
FastClickCheckUtil.check(view); |
|
|
|
|
try { |
|
|
|
|
@ -394,6 +433,7 @@ public class VodController extends BaseController { |
|
|
|
|
} catch (JSONException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
mPlayerIJKBtn.setOnClickListener(new OnClickListener() { |
|
|
|
|
@ -495,7 +535,6 @@ public class VodController extends BaseController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
// takagen99: Add long press to reset counter
|
|
|
|
|
mPlayerTimeSkipBtn.setOnLongClickListener(new OnLongClickListener() { |
|
|
|
|
@Override |
|
|
|
|
public boolean onLongClick(View view) { |
|
|
|
|
@ -531,6 +570,15 @@ public class VodController extends BaseController { |
|
|
|
|
hideBottom(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
mZimuBtn.setOnLongClickListener(new OnLongClickListener() { |
|
|
|
|
@Override |
|
|
|
|
public boolean onLongClick(View view) { |
|
|
|
|
mSubtitleView.setVisibility(View.GONE); |
|
|
|
|
hideBottom(); |
|
|
|
|
Toast.makeText(getContext(), "外挂字幕已关闭", Toast.LENGTH_SHORT).show(); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
mAudioTrackBtn.setOnClickListener(new OnClickListener() { |
|
|
|
|
@Override |
|
|
|
|
public void onClick(View view) { |
|
|
|
|
|