修正点播进度条部分设备显示不全的问题;

设置界面新增: 下次进入 (点播|直播);
直播兼容logo图标配置(当配置为false时强制关闭台标显示);
去除加载jar成功的提示;
修正sites配置的filterable站点过滤参数不生效的问题;
pull/142/head
于俊 1 year ago
parent 24898a72c3
commit 7d0bd970ad
  1. 9
      app/src/main/java/com/github/tvbox/osc/api/ApiConfig.java
  2. 16
      app/src/main/java/com/github/tvbox/osc/player/controller/VodController.java
  3. 16
      app/src/main/java/com/github/tvbox/osc/ui/activity/HomeActivity.java
  4. 19
      app/src/main/java/com/github/tvbox/osc/ui/activity/LivePlayActivity.java
  5. 15
      app/src/main/java/com/github/tvbox/osc/ui/fragment/ModelSettingFragment.java
  6. 1
      app/src/main/java/com/github/tvbox/osc/util/HawkConfig.java
  7. 202
      app/src/main/res/layout/fragment_model.xml
  8. 47
      app/src/main/res/layout/player_vod_control_view.xml

@ -885,6 +885,15 @@ public class ApiConfig {
public List<SourceBean> getSourceBeanList() {
return new ArrayList<>(sourceBeanList.values());
}
public List<SourceBean> getSwitchSourceBeanList() {
List<SourceBean> filteredList = new ArrayList<>();
for (SourceBean bean : sourceBeanList.values()) {
if (bean.getFilterable() == 1) {
filteredList.add(bean);
}
}
return filteredList;
}
public List<ParseBean> getParseBeanList() {
return parseBeanList;

@ -61,9 +61,9 @@ import java.util.Date;
import java.util.Map;
import xyz.doikki.videoplayer.player.VideoView;
import xyz.doikki.videoplayer.util.PlayerUtils;
import static xyz.doikki.videoplayer.util.PlayerUtils.stringForTime;
import static xyz.doikki.videoplayer.util.PlayerUtils.seconds2Time;
public class VodController extends BaseController {
public VodController(@NonNull @NotNull Context context) {
@ -306,8 +306,6 @@ public class VodController extends BaseController {
mGridView.setAdapter(parseAdapter);
parseAdapter.setNewData(ApiConfig.get().getParseBeanList());
mParseRoot.setVisibility(VISIBLE);
mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
@ -747,8 +745,8 @@ public class VodController extends BaseController {
mPlayerIJKBtn.setVisibility(playerType == 1 ? VISIBLE : GONE);
mPlayerScaleBtn.setText(PlayerHelper.getScaleName(mPlayerConfig.getInt("sc")));
mPlayerSpeedBtn.setText("x" + mPlayerConfig.getDouble("sp"));
mPlayerTimeStartBtn.setText(PlayerUtils.stringForTime(mPlayerConfig.getInt("st") * 1000));
mPlayerTimeSkipBtn.setText(PlayerUtils.stringForTime(mPlayerConfig.getInt("et") * 1000));
mPlayerTimeStartBtn.setText(stringForTime(mPlayerConfig.getInt("st") * 1000));
mPlayerTimeSkipBtn.setText(stringForTime(mPlayerConfig.getInt("et") * 1000));
mAudioTrackBtn.setVisibility((playerType == 1) ? VISIBLE : GONE);
} catch (JSONException e) {
e.printStackTrace();
@ -820,9 +818,9 @@ public class VodController extends BaseController {
listener.playNext(true);
}
}
mCurrentTime.setText(PlayerUtils.stringForTime(position));
mTotalTime.setText(PlayerUtils.stringForTime(duration));
seekTime.setText((PlayerUtils.seconds2Time(position)) + " | " + (PlayerUtils.seconds2Time(duration))); //右上角进度条时间显示
mCurrentTime.setText(stringForTime(position));
mTotalTime.setText(stringForTime(duration));
seekTime.setText((seconds2Time(position)) + " | " + (seconds2Time(duration))); //右上角进度条时间显示
if (duration > 0) {
mSeekBar.setEnabled(true);
int pos = (int) (position * 1.0 / duration * mSeekBar.getMax());
@ -878,7 +876,7 @@ public class VodController extends BaseController {
} else {
mProgressIcon.setImageResource(R.drawable.icon_back);
}
mProgressText.setText(PlayerUtils.stringForTime(seekTo) + " / " + PlayerUtils.stringForTime(duration));
mProgressText.setText(stringForTime(seekTo) + " / " + stringForTime(duration));
mHandler.sendEmptyMessage(1000);
mHandler.removeMessages(1001);
mHandler.sendEmptyMessageDelayed(1001, 1000);

@ -265,6 +265,14 @@ public class HomeActivity extends BaseActivity {
tvName.setText(home.getName());
if (dataInitOk && jarInitOk) {
sourceViewModel.getSort(ApiConfig.get().getHomeSourceBean().getKey());
if (hasPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
LOG.e("有");
} else {
LOG.e("无");
}
if (!useCacheConfig && Hawk.get(HawkConfig.DEFAULT_LOAD_LIVE, false)) {
jumpActivity(LivePlayActivity.class);
}
return;
}
showLoading();
@ -277,8 +285,8 @@ public class HomeActivity extends BaseActivity {
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
if (!useCacheConfig)
Toast.makeText(HomeActivity.this, "自定义jar加载成功", Toast.LENGTH_SHORT).show();
// if (!useCacheConfig)
// Toast.makeText(HomeActivity.this, "自定义jar加载成功", Toast.LENGTH_SHORT).show();
initData();
}
}, 50);
@ -610,12 +618,12 @@ public class HomeActivity extends BaseActivity {
}
void showSiteSwitch() {
List<SourceBean> sites = ApiConfig.get().getSourceBeanList();
List<SourceBean> sites = ApiConfig.get().getSwitchSourceBeanList();
if (sites.size() > 0) {
SelectDialog<SourceBean> dialog = new SelectDialog<>(HomeActivity.this);
TvRecyclerView tvRecyclerView = dialog.findViewById(R.id.list);
int spanCount;
spanCount = (int)Math.floor(sites.size()/60);
spanCount = (int)Math.floor(sites.size() / 20);
spanCount = Math.min(spanCount, 2);
tvRecyclerView.setLayoutManager(new V7GridLayoutManager(dialog.getContext(), spanCount+1));
ConstraintLayout cl_root = dialog.findViewById(R.id.cl_root);

@ -417,11 +417,18 @@ public class LivePlayActivity extends BaseActivity {
String channelNameReal = getFirstPartBeforeSpace(channelName);
@SuppressLint("SimpleDateFormat") SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd");
timeFormat.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
String[] epgInfo = EpgUtil.getEpgInfo(channelNameReal);
String epgTagName = channelNameReal;
updateChannelIcon(channelName, epgInfo == null ? null : epgInfo[0]);
if (epgInfo != null && !epgInfo[1].isEmpty()) {
epgTagName = epgInfo[1];
if (logoUrl==null || logoUrl.isEmpty()){
String[] epgInfo = EpgUtil.getEpgInfo(channelNameReal);
if (epgInfo != null && !epgInfo[1].isEmpty()) {
epgTagName = epgInfo[1];
}
updateChannelIcon(channelName, epgInfo == null ? null : epgInfo[0]);
}else if(logoUrl.equals("false")){
updateChannelIcon(channelName, null);
}else {
String logo= logoUrl.replace("{name}",epgTagName);
updateChannelIcon(channelName, logo);
}
epgListAdapter.CanBack(currentLiveChannelItem.getinclude_back());
String url;
@ -825,6 +832,7 @@ public class LivePlayActivity extends BaseActivity {
private JsonObject catchup=null;
private Boolean hasCatchup=false;
private String logoUrl=null;
private void initLiveObj(){
int position=Hawk.get(HawkConfig.LIVE_GROUP_INDEX, 0);
JsonArray live_groups=Hawk.get(HawkConfig.LIVE_GROUP_LIST,new JsonArray());
@ -834,6 +842,9 @@ public class LivePlayActivity extends BaseActivity {
LOG.i("echo-catchup :"+ catchup.toString());
hasCatchup=true;
}
if(livesOBJ.has("logo")){
logoUrl = livesOBJ.get("logo").getAsString();
}
}
private HashMap<String,String> liveWebHeader()

@ -75,6 +75,7 @@ public class ModelSettingFragment extends BaseLazyFragment {
private TextView tvm3u8AdText;
private TextView tvRecStyleText;
private TextView tvIjkCachePlay;
private TextView tvHomeDefaultShow;
public static ModelSettingFragment newInstance() {
return new ModelSettingFragment().setArguments();
@ -126,6 +127,8 @@ public class ModelSettingFragment extends BaseLazyFragment {
tvPlay.setText(PlayerHelper.getPlayerName(Hawk.get(HawkConfig.PLAY_TYPE, 0)));
tvRender.setText(PlayerHelper.getRenderName(Hawk.get(HawkConfig.PLAY_RENDER, 0)));
tvIjkCachePlay.setText(Hawk.get(HawkConfig.IJK_CACHE_PLAY, false) ? "开启" : "关闭");
tvHomeDefaultShow = findViewById(R.id.tvHomeText);
tvHomeDefaultShow.setText(Hawk.get(HawkConfig.DEFAULT_LOAD_LIVE, false) ? "直播" : "点播");
findViewById(R.id.llDebug).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -206,7 +209,7 @@ public class ModelSettingFragment extends BaseLazyFragment {
@Override
public void onClick(View v) {
FastClickCheckUtil.check(v);
List<SourceBean> sites = ApiConfig.get().getSourceBeanList();
List<SourceBean> sites = ApiConfig.get().getSwitchSourceBeanList();
if (sites.size() > 0) {
SelectDialog<SourceBean> dialog = new SelectDialog<>(mActivity);
dialog.setTip("请选择首页数据源");
@ -710,6 +713,16 @@ public class ModelSettingFragment extends BaseLazyFragment {
}
});
//下次进入
findViewById(R.id.tvHomeLive).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FastClickCheckUtil.check(v);
Hawk.put(HawkConfig.DEFAULT_LOAD_LIVE, !Hawk.get(HawkConfig.DEFAULT_LOAD_LIVE, false));
tvHomeDefaultShow.setText(Hawk.get(HawkConfig.DEFAULT_LOAD_LIVE, false) ? "直播" : "点播");
}
});
findViewById(R.id.llIjkCachePlay).setOnClickListener((view -> onClickIjkCachePlay(view)));
findViewById(R.id.llClearCache).setOnClickListener((view -> onClickClearCache(view)));
}

@ -48,5 +48,6 @@ public class HawkConfig {
public static final String M3U8_PURIFY = "m3u8_purify";
public static final String SCREEN_DISPLAY = "screen_display";
public static final String LIVE_WEB_HEADER = "live_web_header";
public static final String DEFAULT_LOAD_LIVE = "DEFAULT_LOAD_LIVE";
public static boolean hotVodDelete;
}

@ -67,10 +67,18 @@
</LinearLayout>
<LinearLayout
android:id="@+id/llHomeApi"
android:layout_width="match_parent"
android:layout_height="@dimen/vs_60"
android:layout_marginBottom="@dimen/vs_10"
android:layout_width="match_parent"
android:layout_height="@dimen/vs_60"
android:layout_marginBottom="@dimen/vs_10"
android:focusable="false"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/llApi"
android:layout_width="@dimen/vs_0"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/vs_5"
android:layout_marginRight="@dimen/vs_5"
android:layout_weight="3.08"
android:background="@drawable/shape_setting_model_focus"
android:focusable="true"
android:gravity="center_vertical"
@ -78,28 +86,70 @@
android:paddingLeft="@dimen/vs_20"
android:paddingRight="@dimen/vs_20">
<TextView
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="配置地址"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_24" />
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:id="@+id/tvApi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="middle"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_24" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/vs_10"
android:layout_marginLeft="@dimen/vs_10"
android:text=">"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_30" />
</LinearLayout>
<LinearLayout
android:id="@+id/llApiHistory"
android:layout_width="@dimen/vs_0"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/vs_5"
android:layout_marginLeft="@dimen/vs_5"
android:layout_weight="1"
android:background="@drawable/shape_setting_model_focus"
android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="@dimen/vs_20"
android:paddingRight="@dimen/vs_20">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="首页数据源"
android:text="配置历史"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_24" />
<Space
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:id="@+id/tvHomeApi"
<TextView
android:id="@+id/tvMediaCodec1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="middle"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_24" />
<TextView
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/vs_10"
@ -107,21 +157,22 @@
android:text=">"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_30" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/vs_60"
android:layout_marginBottom="@dimen/vs_10"
android:focusable="false"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/llApi"
android:layout_width="@dimen/vs_0"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/vs_5"
android:layout_marginRight="@dimen/vs_5"
android:layout_weight="3.08"
android:layout_width="match_parent"
android:layout_height="@dimen/vs_60"
android:layout_marginBottom="@dimen/vs_10"
android:focusable="false"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/llHomeApi"
android:layout_width="@dimen/vs_0"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/vs_5"
android:layout_marginRight="@dimen/vs_5"
android:layout_weight="3.08"
android:background="@drawable/shape_setting_model_focus"
android:focusable="true"
android:gravity="center_vertical"
@ -129,28 +180,71 @@
android:paddingLeft="@dimen/vs_20"
android:paddingRight="@dimen/vs_20">
<TextView
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="首页站源"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_24" />
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:id="@+id/tvHomeApi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="middle"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_24" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/vs_10"
android:layout_marginLeft="@dimen/vs_10"
android:text=">"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_30" />
</LinearLayout>
<LinearLayout
android:id="@+id/tvHomeLive"
android:layout_width="@dimen/vs_0"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/vs_5"
android:layout_marginLeft="@dimen/vs_5"
android:layout_weight="1"
android:background="@drawable/shape_setting_model_focus"
android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="@dimen/vs_20"
android:paddingRight="@dimen/vs_20">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="配置地址"
android:text="下次进入"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_24" />
<Space
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:id="@+id/tvApi"
<TextView
android:id="@+id/tvHomeText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="middle"
android:singleLine="true"
android:textColor="@android:color/white"
android:text="点播"
android:textSize="@dimen/ts_24" />
<TextView
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/vs_10"
@ -158,50 +252,8 @@
android:text=">"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_30" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/llApiHistory"
android:layout_width="@dimen/vs_0"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/vs_5"
android:layout_marginLeft="@dimen/vs_5"
android:layout_weight="1"
android:background="@drawable/shape_setting_model_focus"
android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="@dimen/vs_20"
android:paddingRight="@dimen/vs_20">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="配置历史"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_24" />
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:id="@+id/tvMediaCodec1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_24" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/vs_10"
android:layout_marginLeft="@dimen/vs_10"
android:text=">"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_30" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"

@ -434,20 +434,21 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/vs_10"
android:orientation="horizontal">
android:orientation="horizontal"
android:baselineAligned="false"
android:gravity="center_vertical">
<TextView
android:id="@+id/curr_time"
android:layout_width="50dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingEnd="@dimen/vs_10"
android:paddingRight="@dimen/vs_10"
android:layout_weight="1"
android:minWidth="48dp"
android:paddingStart="@dimen/vs_0"
android:paddingEnd="@dimen/vs_0"
android:text="@string/_00_00"
android:textColor="@color/color_FFFFFF"
android:textSize="@dimen/ts_20"
android:singleLine="true"
android:ellipsize="end"
android:gravity="end"
android:gravity="end|center_vertical"
android:textAllCaps="true"
android:includeFontPadding="false"
tools:ignore="RtlSymmetry" />
@ -456,34 +457,34 @@
android:id="@+id/seekBar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:background="@null"
android:focusable="false"
android:focusableInTouchMode="false"
android:layout_weight="16"
android:layout_gravity="center_vertical"
android:max="1000"
android:maxHeight="@dimen/vs_6"
android:minHeight="@dimen/vs_6"
android:padding="@dimen/vs_0"
android:paddingStart="@dimen/vs_0"
android:paddingEnd="@dimen/vs_0"
android:progressDrawable="@drawable/shape_player_control_vod_seek"
android:thumb="@drawable/shape_player_control_vod_seek_thumb"
android:thumbOffset="@dimen/vs_0" />
android:background="@null"
android:maxHeight="@dimen/vs_6"
android:minHeight="@dimen/vs_6"
android:paddingVertical="@dimen/vs_2"
android:focusable="false"
android:focusableInTouchMode="false" />
<TextView
android:id="@+id/total_time"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingStart="@dimen/vs_10"
android:paddingLeft="@dimen/vs_10"
android:layout_weight="1"
android:minWidth="48dp"
android:paddingStart="@dimen/vs_0"
android:paddingEnd="@dimen/vs_0"
android:text="@string/_00_00"
android:textColor="@color/color_FFFFFF"
android:textSize="@dimen/ts_20"
android:gravity="start|center_vertical"
android:includeFontPadding="false"
tools:ignore="RtlSymmetry" />
</LinearLayout>
</LinearLayout>
<FrameLayout

Loading…
Cancel
Save