|
|
|
|
@ -7,6 +7,7 @@ import android.os.Bundle; |
|
|
|
|
import android.text.TextUtils; |
|
|
|
|
import android.view.accessibility.CaptioningManager; |
|
|
|
|
|
|
|
|
|
import androidx.media3.common.C; |
|
|
|
|
import androidx.media3.common.MediaItem; |
|
|
|
|
import androidx.media3.common.MimeTypes; |
|
|
|
|
import androidx.media3.common.PlaybackException; |
|
|
|
|
@ -64,6 +65,12 @@ public class ExoUtil { |
|
|
|
|
return Setting.isCaption() ? CaptionStyleCompat.createFromCaptionStyle(((CaptioningManager) App.get().getSystemService(Context.CAPTIONING_SERVICE)).getUserStyle()) : new CaptionStyleCompat(Color.WHITE, Color.TRANSPARENT, Color.TRANSPARENT, CaptionStyleCompat.EDGE_TYPE_OUTLINE, Color.BLACK, null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static boolean shouldSoftDecode(Tracks tracks) { |
|
|
|
|
if (!haveTrack(tracks, C.TRACK_TYPE_VIDEO)) return false; |
|
|
|
|
for (Tracks.Group trackGroup : tracks.getGroups()) if (trackGroup.getType() == C.TRACK_TYPE_VIDEO && trackGroup.isSupported(true)) return false; |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static boolean haveTrack(Tracks tracks, int type) { |
|
|
|
|
int count = 0; |
|
|
|
|
for (Tracks.Group trackGroup : tracks.getGroups()) if (trackGroup.getType() == type) count += trackGroup.length; |
|
|
|
|
|