直播微调;嗅探词微调;下拉选择框微调

pull/77/head
于俊 3 years ago
parent 2d5b4c8ee6
commit e729d144a2
  1. 1
      app/src/main/java/com/github/tvbox/osc/ui/activity/DetailActivity.java
  2. 60
      app/src/main/java/com/github/tvbox/osc/ui/activity/LivePlayActivity.java
  3. 16
      app/src/main/java/com/github/tvbox/osc/ui/adapter/SelectDialogAdapter.java
  4. 31
      app/src/main/java/com/github/tvbox/osc/util/DefaultConfig.java
  5. 4
      app/src/main/res/layout/activity_detail.xml
  6. 6
      app/src/main/res/layout/activity_live_play.xml

@ -666,7 +666,6 @@ public class DetailActivity extends BaseActivity {
jumpToPlay();
llPlayerFragmentContainer.setVisibility(View.VISIBLE);
llPlayerFragmentContainerBlock.setVisibility(View.VISIBLE);
llPlayerFragmentContainerBlock.requestFocus();
toggleSubtitleTextSize();
}
// startQuickSearch();

@ -55,6 +55,7 @@ import com.github.tvbox.osc.util.EpgUtil;
import com.github.tvbox.osc.util.FastClickCheckUtil;
import com.github.tvbox.osc.util.HawkConfig;
import com.github.tvbox.osc.util.LOG;
import com.github.tvbox.osc.util.PlayerHelper;
import com.github.tvbox.osc.util.live.TxtSubscribe;
import com.github.tvbox.osc.util.urlhttp.CallBackUtil;
import com.github.tvbox.osc.util.urlhttp.UrlHttpUtil;
@ -131,7 +132,6 @@ public class LivePlayActivity extends BaseActivity {
private CountDownTimer countDownTimerRightTop;
private View ll_right_top_loading;
private View ll_right_top_huikan;
private View tv_tiploading;
private View divLoadEpg;
private View divLoadEpgleft;
private LinearLayout divEpg;
@ -231,7 +231,6 @@ public class LivePlayActivity extends BaseActivity {
tv_right_top_type = (TextView)findViewById(R.id.tv_right_top_type);
iv_circle_bg = (ImageView) findViewById(R.id.iv_circle_bg);
iv_back_bg = (ImageView) findViewById(R.id.iv_back_bg);
tv_tiploading= (View) findViewById(R.id.ll_right_top_loading);
tv_shownum = (TextView) findViewById(R.id.tv_shownum);
txtNoEpg = (TextView) findViewById(R.id.txtNoEpg);
ll_right_top_loading = findViewById(R.id.ll_right_top_loading);
@ -402,14 +401,6 @@ public class LivePlayActivity extends BaseActivity {
}
});
}
}else {
Epginfo epgbcinfo = new Epginfo(date,"暂无节目信息", date, "00:00", "23:59",0);
arrayList.add(epgbcinfo);
epgdata = arrayList;
epgListAdapter.setNewData(epgdata);
// mRightEpgList.setAdapter(epgListAdapter);
}
}
@ -473,12 +464,11 @@ public class LivePlayActivity extends BaseActivity {
if (isSHIYI)
return;
if (channel_Name.getChannelName() != null) {
findViewById(R.id.ll_epg).setVisibility(View.VISIBLE);
((TextView) findViewById(R.id.tv_channel_bar_name)).setText(channel_Name.getChannelName());
((TextView) findViewById(R.id.tv_channel_bottom_number)).setText("" + channel_Name.getChannelNum());
((TextView) findViewById(R.id.tv_current_program_time)).setText("暂无信息");
tip_epg1.setText("暂无信息");
((TextView) findViewById(R.id.tv_current_program_name)).setText("");
((TextView) findViewById(R.id.tv_next_program_time)).setText("开源测试软件,请勿商用以及播放违法内容");
tip_epg2.setText("开源测试软件,请勿商用以及播放违法内容");
((TextView) findViewById(R.id.tv_next_program_name)).setText("");
String savedEpgKey = channel_Name.getChannelName() + "_" + liveEpgDateAdapter.getItem(liveEpgDateAdapter.getSelectedIndex()).getDatePresented();
if (hsEpg.containsKey(savedEpgKey)) {
@ -489,10 +479,10 @@ public class LivePlayActivity extends BaseActivity {
int size = arrayList.size() - 1;
while (size >= 0) {
if (new Date().compareTo(((Epginfo) arrayList.get(size)).startdateTime) >= 0) {
((TextView) findViewById(R.id.tv_current_program_time)).setText(((Epginfo) arrayList.get(size)).start + "--" + ((Epginfo) arrayList.get(size)).end);
tip_epg1.setText(((Epginfo) arrayList.get(size)).start + "--" + ((Epginfo) arrayList.get(size)).end);
((TextView) findViewById(R.id.tv_current_program_name)).setText(((Epginfo) arrayList.get(size)).title);
if (size != arrayList.size() - 1) {
((TextView) findViewById(R.id.tv_next_program_time)).setText(((Epginfo) arrayList.get(size + 1)).start + "--" + ((Epginfo) arrayList.get(size)).end);
tip_epg2.setText(((Epginfo) arrayList.get(size + 1)).start + "--" + ((Epginfo) arrayList.get(size)).end);
((TextView) findViewById(R.id.tv_next_program_name)).setText(((Epginfo) arrayList.get(size + 1)).title);
}
break;
@ -514,14 +504,19 @@ public class LivePlayActivity extends BaseActivity {
if (countDownTimer != null) {
countDownTimer.cancel();
}
countDownTimer = new CountDownTimer(5000, 1000) {//底部epg隐藏时间设定
public void onTick(long j) {
}
public void onFinish() {
findViewById(R.id.ll_epg).setVisibility(View.GONE);
}
};
countDownTimer.start();
if(!tip_epg1.getText().equals("暂无信息")){
ll_epg.setVisibility(View.VISIBLE);
countDownTimer = new CountDownTimer(8000, 1000) {//底部epg隐藏时间设定
public void onTick(long j) {
}
public void onFinish() {
ll_epg.setVisibility(View.GONE);
}
};
countDownTimer.start();
}else {
ll_epg.setVisibility(View.GONE);
}
if (channel_Name == null || channel_Name.getSourceNum() <= 0) {
((TextView) findViewById(R.id.tv_source)).setText("1/1");
} else {
@ -544,8 +539,6 @@ public class LivePlayActivity extends BaseActivity {
}
};
mHandler.post(mUpdateNetSpeedRun);
tv_right_top_tipnetspeed.setVisibility(View.VISIBLE);
}
countDownTimerRightTop.start();
}
@ -558,7 +551,6 @@ public class LivePlayActivity extends BaseActivity {
liveIconNullText.setText("" + channel_Name.getChannelNum());
} else {
imgLiveIcon.setVisibility(View.VISIBLE);
LOG.i("live icon: " + logoUrl);
Picasso.get().load(logoUrl).placeholder(R.drawable.app_banner).into(imgLiveIcon);
liveIconNullBg.setVisibility(View.INVISIBLE);
liveIconNullText.setVisibility(View.INVISIBLE);
@ -568,19 +560,15 @@ public class LivePlayActivity extends BaseActivity {
//频道列表
public void divLoadEpgRight(View view) {
mChannelGroupView.setVisibility(View.GONE);
divEpg.setVisibility(View.VISIBLE);
divLoadEpgleft.setVisibility(View.VISIBLE);
divLoadEpg.setVisibility(View.GONE);
mRightEpgList.setSelectedPosition(epgListAdapter.getSelectedIndex());
epgListAdapter.notifyDataSetChanged();
}
//频道列表
public void divLoadEpgLeft(View view) {
// mRightEpgList.setVisibility(View.GONE);
mChannelGroupView.setVisibility(View.VISIBLE);
divEpg.setVisibility(View.GONE);
divLoadEpgleft.setVisibility(View.GONE);
@ -684,6 +672,7 @@ public class LivePlayActivity extends BaseActivity {
if (tvRightSettingLayout.getVisibility() == View.VISIBLE) {
mHandler.removeCallbacks(mHideSettingLayoutRun);
mHandler.post(mHideSettingLayoutRun);
return;
}
if (tvLeftChannelListLayout.getVisibility() == View.INVISIBLE) {
//重新载入上一次状态
@ -1697,6 +1686,7 @@ public class LivePlayActivity extends BaseActivity {
};
private void showNetSpeed() {
tv_right_top_tipnetspeed.setVisibility(View.VISIBLE);
if (Hawk.get(HawkConfig.LIVE_SHOW_NET_SPEED, false)) {
mHandler.post(mUpdateNetSpeedRun);
tvNetSpeed.setVisibility(View.VISIBLE);
@ -1710,8 +1700,9 @@ public class LivePlayActivity extends BaseActivity {
@Override
public void run() {
if (mVideoView == null) return;
tvNetSpeed.setText(String.format("%.2fMb/s", (float)mVideoView.getTcpSpeed() / 1024.0 / 1024.0));
tv_right_top_tipnetspeed.setText(String.format("%.2fKb/s",(float)mVideoView.getTcpSpeed()/1024.0));
String speed = PlayerHelper.getDisplaySpeed(mVideoView.getTcpSpeed());
tvNetSpeed.setText(speed);
tv_right_top_tipnetspeed.setText(speed);
mHandler.postDelayed(this, 1000);
}
};
@ -1902,10 +1893,11 @@ public class LivePlayActivity extends BaseActivity {
if(show){
backcontroller.setVisibility(View.VISIBLE);
ll_epg.setVisibility(View.GONE);
}else{
backcontroller.setVisibility(View.GONE);
ll_epg.setVisibility(View.VISIBLE);
if(!tip_epg1.getText().equals("暂无信息")){
ll_epg.setVisibility(View.VISIBLE);
}
}

@ -1,6 +1,8 @@
package com.github.tvbox.osc.ui.adapter;
import android.annotation.SuppressLint;
import android.graphics.Color;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -52,7 +54,7 @@ public class SelectDialogAdapter<T> extends ListAdapter<T, SelectDialogAdapter.S
private int select = 0;
private SelectDialogInterface dialogInterface = null;
private SelectDialogInterface dialogInterface;
public SelectDialogAdapter(SelectDialogInterface dialogInterface, DiffUtil.ItemCallback diffCallback) {
super(diffCallback);
@ -81,9 +83,15 @@ public class SelectDialogAdapter<T> extends ListAdapter<T, SelectDialogAdapter.S
public void onBindViewHolder(@NonNull @NotNull SelectDialogAdapter.SelectViewHolder holder, @SuppressLint("RecyclerView") int position) {
T value = data.get(position);
String name = dialogInterface.getDisplay(value);
if (position == select)
name = "√ " + name;
((TextView) holder.itemView.findViewById(R.id.tvName)).setText(name);
TextView view = holder.itemView.findViewById(R.id.tvName);
if (position == select) {
view.setTextColor(0xff02f8e1);
view .setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
}else {
view.setTextColor(Color.WHITE);
view .setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
}
view.setText(name);
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

@ -107,20 +107,20 @@ public class DefaultConfig {
}
private static final Pattern snifferMatch = Pattern.compile(
"http((?!http).){20,}?\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg)\\?.*|" +
"http((?!http).){20,}\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg)|" +
"http((?!http).)*?video/tos*|" +
"http((?!http).){20,}?/m3u8\\?pt=m3u8.*|" +
"http((?!http).)*?default\\.ixigua\\.com/.*|" +
"http((?!http).)*?dycdn-tos\\.pstatp[^\\?]*|" +
"http.*?/player/m3u8play\\.php\\?url=.*|" +
"http.*?/player/.*?[pP]lay\\.php\\?url=.*|" +
"http.*?/playlist/m3u8/\\?vid=.*|" +
"http.*?\\.php\\?type=m3u8&.*|" +
"http.*?/download.aspx\\?.*|" +
"http.*?/api/up_api.php\\?.*|" +
"https.*?\\.66yk\\.cn.*|" +
"http((?!http).)*?netease\\.com/file/.*"
"http((?!http).){12,}?\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg|m4a)\\?.*|" +
"http((?!http).){12,}\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg|m4a)|" +
"http((?!http).)*?video/tos*|" +
"http((?!http).){20,}?/m3u8\\?pt=m3u8.*|" +
"http((?!http).)*?default\\.ixigua\\.com/.*|" +
"http((?!http).)*?dycdn-tos\\.pstatp[^\\?]*|" +
"http.*?/player/m3u8play\\.php\\?url=.*|" +
"http.*?/player/.*?[pP]lay\\.php\\?url=.*|" +
"http.*?/playlist/m3u8/\\?vid=.*|" +
"http.*?\\.php\\?type=m3u8&.*|" +
"http.*?/download.aspx\\?.*|" +
"http.*?/api/up_api.php\\?.*|" +
"https.*?\\.66yk\\.cn.*|" +
"http((?!http).)*?netease\\.com/file/.*"
);
public static boolean isVideoFormat(String url) {
Uri uri = Uri.parse(url);
@ -128,9 +128,6 @@ public class DefaultConfig {
if (TextUtils.isEmpty(path)) {
return false;
}
// if (path.endsWith(".js") || path.endsWith(".css") || path.endsWith(".html")) {
// return false;
// }
if (snifferMatch.matcher(url).find()) return true;
return false;
}

@ -294,7 +294,7 @@
android:layout_height="@dimen/vs_320"
android:layout_marginStart="@dimen/vs_50"
android:layout_marginLeft="@dimen/vs_50"
android:layout_marginTop="@dimen/vs_10"
android:layout_marginTop="@dimen/vs_20"
android:layout_marginBottom="@dimen/vs_10"
android:visibility="gone" />
@ -306,7 +306,7 @@
android:background="@drawable/preview_player_block"
android:layout_marginStart="@dimen/vs_50"
android:layout_marginLeft="@dimen/vs_50"
android:layout_marginTop="@dimen/vs_10"
android:layout_marginTop="@dimen/vs_20"
android:layout_marginBottom="@dimen/vs_10"
android:visibility="gone" />
</FrameLayout>

@ -369,11 +369,12 @@
<TextView
android:id="@+id/tvTime"
android:paddingRight="@dimen/vs_20"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="5mm"
android:layout_marginRight="5mm"
android:layout_marginRight="10mm"
android:background="@android:color/transparent"
android:gravity="center"
android:textColor="@android:color/white"
@ -381,11 +382,12 @@
android:visibility="gone" />
<TextView
android:id="@+id/tvNetSpeed"
android:paddingRight="@dimen/vs_20"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_marginBottom="5mm"
android:layout_marginRight="5mm"
android:layout_marginRight="10mm"
android:background="@android:color/transparent"
android:gravity="center"
android:textColor="@android:color/white"

Loading…
Cancel
Save