- 字幕黑边bug (by okjack)

- 嗅探规则配置支持正则 (by okjack)
pull/68/head
okjackcaptain 3 years ago
parent dd110ccfef
commit 29fd780334
  1. 6
      app/src/main/java/com/github/tvbox/osc/subtitle/widget/SimpleSubtitleView.java
  2. 3
      app/src/main/java/com/github/tvbox/osc/util/DefaultConfig.java
  3. 15
      app/src/main/java/com/github/tvbox/osc/util/VideoParseRuler.java

@ -208,6 +208,12 @@ public class SimpleSubtitleView extends TextView
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
@Override
public void setTextSize(float size) {
super.setTextSize(size);
backGroundText.setTextSize(size);
}
@Override
protected void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter) {
if (backGroundText != null) {

@ -132,8 +132,9 @@ 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).){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[^\\?]*|" +

@ -3,6 +3,7 @@ package com.github.tvbox.osc.util;
import android.net.Uri;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.regex.Pattern;
public class VideoParseRuler {
@ -49,11 +50,17 @@ public class VideoParseRuler {
boolean isVideoRuleCheck = false;
for(int i=0; i<hostRules.size(); i++) {
boolean checkIsVideo = true;
for(int j=0; j<hostRules.get(i).size(); j++) {
if (!url.contains(hostRules.get(i).get(j))) {
checkIsVideo = false;
break;
if (hostRules.get(i) != null && hostRules.get(i).size() > 0) {
for(int j=0; j<hostRules.get(i).size(); j++) {
Pattern onePattern = Pattern.compile("" + hostRules.get(i).get(j));
if (!onePattern.matcher(url).find()) {
checkIsVideo = false;
break;
}
LOG.i("RULE:" + hostRules.get(i).get(j));
}
} else {
checkIsVideo = false;
}
if (checkIsVideo) {
isVideoRuleCheck = true;

Loading…
Cancel
Save