Skip to content

Commit

Permalink
修正
Browse files Browse the repository at this point in the history
  • Loading branch information
q215613905 committed Sep 24, 2024
1 parent 8b63bf8 commit a2bb307
Show file tree
Hide file tree
Showing 20 changed files with 158 additions and 91 deletions.
7 changes: 4 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ dependencies {
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation files('libs/thunder.jar')
implementation files('libs/commons-lang3-3.12.0.jar')
implementation files('libs/xwalk_shared_library-23.53.589.4.aar')

implementation 'com.squareup.okhttp3:okhttp:3.12.11'
annotationProcessor 'androidx.room:room-compiler:2.3.0'
Expand All @@ -90,9 +91,9 @@ dependencies {
implementation project(":player")
implementation project(":quickjs")

implementation('org.xwalk:xwalk_shared_library:23.53.589.4') {
exclude group: 'com.android.support'
}
// implementation('org.xwalk:xwalk_shared_library:23.53.589.4') {
// exclude group: 'com.android.support'
// }
implementation 'com.lzy.net:okgo:3.0.4'
// implementation 'com.tencent.bugly:crashreport_upgrade:latest.release'
implementation 'com.owen:tv-recyclerview:3.0.0'
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/java/com/github/tvbox/osc/api/ApiConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,11 @@ public void loadConfig(boolean useCache, LoadConfigCallback callback, Activity a
} else if (apiUrl.startsWith("clan")) {
configUrl = clanToAddress(apiUrl);
} else if (!apiUrl.startsWith("http")) {
configUrl = "http://" + configUrl;
configUrl = "http://" + apiUrl;
} else {
configUrl = apiUrl;
}

String configKey = TempKey;
OkGo.<String>get(configUrl)
.headers("User-Agent", userAgent)
Expand Down Expand Up @@ -502,7 +503,7 @@ private void parseJson(String apiUrl, String jsonStr) {
if(ijkCodes==null){
ijkCodes = new ArrayList<>();
boolean foundOldSelect = false;
String ijkCodec = Hawk.get(HawkConfig.IJK_CODEC, "");
String ijkCodec = Hawk.get(HawkConfig.IJK_CODEC, "硬解码");
JsonArray ijkJsonArray = infoJson.has("ijk")?infoJson.get("ijk").getAsJsonArray():defaultJson.get("ijk").getAsJsonArray();
for (JsonElement opt : ijkJsonArray) {
JsonObject obj = (JsonObject) opt;
Expand Down Expand Up @@ -660,7 +661,7 @@ public List<IJKCode> getIjkCodes() {
}

public IJKCode getCurrentIJKCode() {
String codeName = Hawk.get(HawkConfig.IJK_CODEC, "");
String codeName = Hawk.get(HawkConfig.IJK_CODEC, "硬解码");
return getIJKCodec(codeName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class LivePlayerManager {
public void init(VideoView videoView) {
try {
defaultPlayerConfig.put("pl", Hawk.get(HawkConfig.PLAY_TYPE, 0));
defaultPlayerConfig.put("ijk", Hawk.get(HawkConfig.IJK_CODEC, "软解码"));
defaultPlayerConfig.put("ijk", Hawk.get(HawkConfig.IJK_CODEC, "硬解码"));
defaultPlayerConfig.put("pr", Hawk.get(HawkConfig.PLAY_RENDER, 0));
defaultPlayerConfig.put("sc", Hawk.get(HawkConfig.PLAY_SCALE, 0));
} catch (JSONException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ public void setOptions() {
}

// 在每个数据包之后启用 I/O 上下文的刷新
mMediaPlayer.setOption(tv.danmaku.ijk.media.player.IjkMediaPlayer.OPT_CATEGORY_FORMAT, "flush_packets", 1);
// 当 CPU 处理不过来的时候的丢帧帧数,默认为 0,参数范围是 [-1, 120]
mMediaPlayer.setOption(tv.danmaku.ijk.media.player.IjkMediaPlayer.OPT_CATEGORY_PLAYER, "framedrop", 5);
// mMediaPlayer.setOption(tv.danmaku.ijk.media.player.IjkMediaPlayer.OPT_CATEGORY_FORMAT, "flush_packets", 1);
// 设置视频流格式
mMediaPlayer.setOption(tv.danmaku.ijk.media.player.IjkMediaPlayer.OPT_CATEGORY_PLAYER, "overlay-format", tv.danmaku.ijk.media.player.IjkMediaPlayer.SDL_FCC_RV32);

Expand Down Expand Up @@ -132,12 +130,13 @@ public TrackInfo getTrackInfo() {
int index = 0;
for (IjkTrackInfo info : trackInfo) {
if (info.getTrackType() == ITrackInfo.MEDIA_TRACK_TYPE_AUDIO) {//音轨信息
TrackInfoBean t = new TrackInfoBean();
t.name = info.getInfoInline();
t.language = info.getLanguage();
t.index = index;
t.selected = index == audioSelected;
data.addAudio(t);
TrackInfoBean a = new TrackInfoBean();
a.name = info.getInfoInline();
a.language = info.getLanguage();
a.index = index;
a.selected = index == audioSelected;
// 如果需要,还可以检查轨道的描述或标题以获取更多信息
data.addAudio(a);
}
if (info.getTrackType() == ITrackInfo.MEDIA_TRACK_TYPE_TIMEDTEXT) {//内置字幕
TrackInfoBean t = new TrackInfoBean();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ protected void init() {
divEpg = (LinearLayout) findViewById(R.id.divEPG);
//右上角图片旋转
objectAnimator = ObjectAnimator.ofFloat(iv_circle_bg,"rotation", 360.0f);
objectAnimator.setDuration(5000);
objectAnimator.setDuration(6000);
objectAnimator.setRepeatCount(-1);
objectAnimator.start();

Expand Down Expand Up @@ -507,7 +507,7 @@ private void showBottomEpg() {
}
if(!tip_epg1.getText().equals("暂无信息")){
ll_epg.setVisibility(View.VISIBLE);
countDownTimer = new CountDownTimer(5000, 1000) {//底部epg隐藏时间设定
countDownTimer = new CountDownTimer(6000, 1000) {//底部epg隐藏时间设定
public void onTick(long j) {
}
public void onFinish() {
Expand Down Expand Up @@ -536,7 +536,7 @@ public void run() {
ll_right_top_loading.setVisibility(View.GONE);
ll_right_top_huikan.setVisibility(View.GONE);
}
}, 5000);
}, 6000);
}
}

Expand Down Expand Up @@ -706,7 +706,7 @@ public void run() {
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
mHandler.removeCallbacks(mHideChannelListRun);
mHandler.postDelayed(mHideChannelListRun, 5000);
mHandler.postDelayed(mHideChannelListRun, 6000);
}
});
animator.start();
Expand Down Expand Up @@ -860,7 +860,7 @@ public void run() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
mHandler.postDelayed(mHideSettingLayoutRun, 5000);
mHandler.postDelayed(mHideSettingLayoutRun, 6000);
}
});
animator.start();
Expand Down Expand Up @@ -902,7 +902,7 @@ private void initEpgListView() {
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
mHandler.removeCallbacks(mHideChannelListRun);
mHandler.postDelayed(mHideChannelListRun, 5000);
mHandler.postDelayed(mHideChannelListRun, 6000);
}
});
//电视
Expand All @@ -915,7 +915,7 @@ public void onItemPreSelected(TvRecyclerView parent, View itemView, int position
@Override
public void onItemSelected(TvRecyclerView parent, View itemView, int position) {
mHandler.removeCallbacks(mHideChannelListRun);
mHandler.postDelayed(mHideChannelListRun, 5000);
mHandler.postDelayed(mHideChannelListRun, 6000);
epgListAdapter.setFocusedEpgIndex(position);
}

Expand Down Expand Up @@ -1110,7 +1110,7 @@ private void initEpgDateView() {
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
mHandler.removeCallbacks(mHideChannelListRun);
mHandler.postDelayed(mHideChannelListRun, 5000);
mHandler.postDelayed(mHideChannelListRun, 6000);
}
});

Expand All @@ -1124,14 +1124,14 @@ public void onItemPreSelected(TvRecyclerView parent, View itemView, int position
@Override
public void onItemSelected(TvRecyclerView parent, View itemView, int position) {
mHandler.removeCallbacks(mHideChannelListRun);
mHandler.postDelayed(mHideChannelListRun, 5000);
mHandler.postDelayed(mHideChannelListRun, 6000);
liveEpgDateAdapter.setFocusedIndex(position);
}

@Override
public void onItemClick(TvRecyclerView parent, View itemView, int position) {
mHandler.removeCallbacks(mHideChannelListRun);
mHandler.postDelayed(mHideChannelListRun, 5000);
mHandler.postDelayed(mHideChannelListRun, 6000);
liveEpgDateAdapter.setSelectedIndex(position);
getEpg(liveEpgDateAdapter.getData().get(position).getDateParamVal());
}
Expand All @@ -1143,7 +1143,7 @@ public void onItemClick(TvRecyclerView parent, View itemView, int position) {
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
FastClickCheckUtil.check(view);
mHandler.removeCallbacks(mHideChannelListRun);
mHandler.postDelayed(mHideChannelListRun, 5000);
mHandler.postDelayed(mHideChannelListRun, 6000);
liveEpgDateAdapter.setSelectedIndex(position);
getEpg(liveEpgDateAdapter.getData().get(position).getDateParamVal());
}
Expand Down Expand Up @@ -1182,12 +1182,12 @@ public void playStateChanged(int playState) {
case VideoView.STATE_ERROR:
case VideoView.STATE_PLAYBACK_COMPLETED:
mHandler.removeCallbacks(mConnectTimeoutChangeSourceRun);
mHandler.postDelayed(mConnectTimeoutChangeSourceRun, 2000);
mHandler.postDelayed(mConnectTimeoutChangeSourceRun, 6000);
break;
case VideoView.STATE_PREPARING:
case VideoView.STATE_BUFFERING:
mHandler.removeCallbacks(mConnectTimeoutChangeSourceRun);
mHandler.postDelayed(mConnectTimeoutChangeSourceRun, (Hawk.get(HawkConfig.LIVE_CONNECT_TIMEOUT, 1) + 1) * 5000);
mHandler.postDelayed(mConnectTimeoutChangeSourceRun, (Hawk.get(HawkConfig.LIVE_CONNECT_TIMEOUT, 1) + 1) * 6000);
break;
}
}
Expand Down Expand Up @@ -1237,7 +1237,7 @@ private void initChannelGroupView() {
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
mHandler.removeCallbacks(mHideChannelListRun);
mHandler.postDelayed(mHideChannelListRun, 5000);
mHandler.postDelayed(mHideChannelListRun, 6000);
}
});

Expand Down Expand Up @@ -1285,7 +1285,7 @@ private void selectChannelGroup(int groupIndex, boolean focus, int liveChannelIn
}
if (tvLeftChannelListLayout.getVisibility() == View.VISIBLE) {
mHandler.removeCallbacks(mHideChannelListRun);
mHandler.postDelayed(mHideChannelListRun, 5000);
mHandler.postDelayed(mHideChannelListRun, 6000);
}
}

Expand All @@ -1300,7 +1300,7 @@ private void initLiveChannelView() {
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
mHandler.removeCallbacks(mHideChannelListRun);
mHandler.postDelayed(mHideChannelListRun, 5000);
mHandler.postDelayed(mHideChannelListRun, 6000);
}
});

Expand All @@ -1316,7 +1316,7 @@ public void onItemSelected(TvRecyclerView parent, View itemView, int position) {
liveChannelGroupAdapter.setFocusedGroupIndex(-1);
liveChannelItemAdapter.setFocusedChannelIndex(position);
mHandler.removeCallbacks(mHideChannelListRun);
mHandler.postDelayed(mHideChannelListRun, 5000);
mHandler.postDelayed(mHideChannelListRun, 6000);
}

@Override
Expand All @@ -1340,7 +1340,7 @@ private void clickLiveChannel(int position) {
playChannel(liveChannelGroupAdapter.getSelectedGroupIndex(), position, false);
if (tvLeftChannelListLayout.getVisibility() == View.VISIBLE) {
mHandler.removeCallbacks(mHideChannelListRun);
mHandler.postDelayed(mHideChannelListRun, 5000);
mHandler.postDelayed(mHideChannelListRun, 6000);
}
}

Expand All @@ -1355,7 +1355,7 @@ private void initSettingGroupView() {
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
mHandler.removeCallbacks(mHideSettingLayoutRun);
mHandler.postDelayed(mHideSettingLayoutRun, 5000);
mHandler.postDelayed(mHideSettingLayoutRun, 6000);
}
});

Expand Down Expand Up @@ -1412,7 +1412,7 @@ private void selectSettingGroup(int position, boolean focus) {
if (scrollToPosition < 0) scrollToPosition = 0;
mSettingItemView.scrollToPosition(scrollToPosition);
mHandler.removeCallbacks(mHideSettingLayoutRun);
mHandler.postDelayed(mHideSettingLayoutRun, 5000);
mHandler.postDelayed(mHideSettingLayoutRun, 6000);
}

private void initSettingItemView() {
Expand All @@ -1426,7 +1426,7 @@ private void initSettingItemView() {
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
mHandler.removeCallbacks(mHideSettingLayoutRun);
mHandler.postDelayed(mHideSettingLayoutRun, 5000);
mHandler.postDelayed(mHideSettingLayoutRun, 6000);
}
});

Expand All @@ -1442,7 +1442,7 @@ public void onItemSelected(TvRecyclerView parent, View itemView, int position) {
liveSettingGroupAdapter.setFocusedGroupIndex(-1);
liveSettingItemAdapter.setFocusedItemIndex(position);
mHandler.removeCallbacks(mHideSettingLayoutRun);
mHandler.postDelayed(mHideSettingLayoutRun, 5000);
mHandler.postDelayed(mHideSettingLayoutRun, 6000);
}

@Override
Expand Down Expand Up @@ -1511,7 +1511,7 @@ private void clickSettingItem(int position) {
break;
}
mHandler.removeCallbacks(mHideSettingLayoutRun);
mHandler.postDelayed(mHideSettingLayoutRun, 5000);
mHandler.postDelayed(mHideSettingLayoutRun, 6000);
}

private void initLiveChannelList() {
Expand Down Expand Up @@ -1720,7 +1720,7 @@ public void onChange(String password) {
}

if (tvLeftChannelListLayout.getVisibility() == View.VISIBLE)
mHandler.postDelayed(mHideChannelListRun, 5000);
mHandler.postDelayed(mHideChannelListRun, 6000);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ public void run() {
void playUrl(String url, HashMap<String, String> headers) {
LOG.i("playUrl:" + url);
if(autoRetryCount>1 && url.contains(".m3u8")){
url="http://home.jundie.top:666/unBom.php?m3u8="+url;//尝试去bom头再次播放
//todo
}
final String finalUrl = url;
runOnUiThread(new Runnable() {
Expand Down Expand Up @@ -559,6 +559,7 @@ private void initSubtitleView() {
((IjkMediaPlayer)(mVideoView.getMediaPlayer())).setOnTimedTextListener(new IMediaPlayer.OnTimedTextListener() {
@Override
public void onTimedText(IMediaPlayer mp, IjkTimedText text) {
if(text==null)return;
if (mController.mSubtitleView.isInternal) {
com.github.tvbox.osc.subtitle.model.Subtitle subtitle = new com.github.tvbox.osc.subtitle.model.Subtitle();
subtitle.content = text.getText();
Expand Down Expand Up @@ -712,7 +713,7 @@ void initPlayerCfg() {
mVodPlayerCfg.put("pr", Hawk.get(HawkConfig.PLAY_RENDER, 0));
}
if (!mVodPlayerCfg.has("ijk")) {
mVodPlayerCfg.put("ijk", Hawk.get(HawkConfig.IJK_CODEC, ""));
mVodPlayerCfg.put("ijk", Hawk.get(HawkConfig.IJK_CODEC, "硬解码"));
}
if (!mVodPlayerCfg.has("sc")) {
mVodPlayerCfg.put("sc", Hawk.get(HawkConfig.PLAY_SCALE, 0));
Expand Down Expand Up @@ -861,8 +862,8 @@ public void play(boolean reset) {
stopParse();
initParseLoadFound();
if(mVideoView!=null) mVideoView.release();
String subtitleCacheKey = mVodInfo.sourceKey + "-" + mVodInfo.id + "-" + mVodInfo.playFlag + "-" + mVodInfo.playIndex+ "-" + vs.name + "-subt";
String progressKey = mVodInfo.sourceKey + mVodInfo.id + mVodInfo.playFlag + mVodInfo.playIndex + vs.name;
subtitleCacheKey = mVodInfo.sourceKey + "-" + mVodInfo.id + "-" + mVodInfo.playFlag + "-" + mVodInfo.playIndex+ "-" + vs.name + "-subt";
progressKey = mVodInfo.sourceKey + mVodInfo.id + mVodInfo.playFlag + mVodInfo.playIndex + vs.name;
//重新播放清除现有进度
if (reset) {
CacheManager.delete(MD5.string2MD5(progressKey), 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected void convert(BaseViewHolder helper, Movie.Video item) {
.load(item.pic)
.transform(new RoundTransformation(MD5.string2MD5(item.pic))
.centerCorp(true)
.override(AutoSizeUtils.mm2px(mContext, 300), AutoSizeUtils.mm2px(mContext, 400))
.override(AutoSizeUtils.mm2px(mContext, 240), AutoSizeUtils.mm2px(mContext, 320))
.roundRadius(AutoSizeUtils.mm2px(mContext, 10), RoundTransformation.RoundType.ALL))
.placeholder(R.drawable.img_loading_placeholder)
.noFade()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected void convert(BaseViewHolder helper, Movie.Video item) {
.roundRadius(AutoSizeUtils.mm2px(mContext, 10), RoundTransformation.RoundType.ALL))
.placeholder(R.drawable.img_loading_placeholder)
.noFade()
// .error(R.drawable.img_loading_placeholder)
.error(R.drawable.img_loading_placeholder)
.into(ivThumb);
} else {
ivThumb.setImageResource(R.drawable.img_loading_placeholder);
Expand Down Expand Up @@ -100,7 +100,7 @@ protected void convert(BaseViewHolder helper, Movie.Video item) {
.roundRadius(AutoSizeUtils.mm2px(mContext, 10), RoundTransformation.RoundType.ALL))
.placeholder(R.drawable.img_loading_placeholder)
.noFade()
// .error(R.drawable.img_loading_placeholder)
.error(R.drawable.img_loading_placeholder)
.into(ivThumb);
} else {
ivThumb.setImageResource(R.drawable.img_loading_placeholder);
Expand Down
Loading

3 comments on commit a2bb307

@hushujiang
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你好,现在actions不能打包编译了,给actions/checkout@v3改成actions/checkout@v4也不行,请问有解决办法吗

@q215613905
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你好,现在actions不能打包编译了,给actions/checkout@v3改成actions/checkout@v4也不行,请问有解决办法吗

好了

@WoKee
Copy link

@WoKee WoKee commented on a2bb307 Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你好,exo播不了荐片资源。 IJK可以。 这个有办法解决吗? 影视和影视仓支持了。

Please sign in to comment.