mirror of
https://github.com/samsonjs/media.git
synced 2026-03-27 09:45:47 +00:00
Cleanup
This commit is contained in:
parent
b06a38b614
commit
94784249eb
4 changed files with 17 additions and 10 deletions
|
|
@ -53,6 +53,7 @@
|
|||
* Add uri field to `LoadEventInfo` in `MediaSourceEventListener` or
|
||||
`AnalyticsListener` callbacks. This uri is the redirected uri if redirection
|
||||
occurred ([#2054](https://github.com/google/ExoPlayer/issues/2054)).
|
||||
* Improved compatibility with FireOS devices.
|
||||
|
||||
### 2.8.2 ###
|
||||
|
||||
|
|
|
|||
|
|
@ -829,7 +829,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
|||
&& !codecNeedsSetOutputSurfaceWorkaround(codecInfo.name)
|
||||
&& (!codecInfo.secure || DummySurface.isSecureSupported(context));
|
||||
}
|
||||
|
||||
|
||||
private void setJoiningDeadlineMs() {
|
||||
joiningDeadlineMs = allowedJoiningTimeMs > 0
|
||||
? (SystemClock.elapsedRealtime() + allowedJoiningTimeMs) : C.TIME_UNSET;
|
||||
|
|
@ -1172,12 +1172,17 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
|||
return Util.SDK_INT <= 22 && "foster".equals(Util.DEVICE) && "NVIDIA".equals(Util.MANUFACTURER);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the device is known to handle {@link DummySurface} incorrectly.
|
||||
*
|
||||
* <p>If true is returned then use of {@link DummySurface} is disabled.
|
||||
*/
|
||||
private static boolean codecNeedsDummySurfaceWorkaround(String name) {
|
||||
// Work around https://github.com/google/ExoPlayer/issues/4419.
|
||||
return (("needle".equals(Util.DEVICE)) // FireTV 4K
|
||||
&& "OMX.amlogic.avc.decoder.awesome".equals(name));
|
||||
return ("Amazon".equals(Util.MANUFACTURER) && "AFTN".equals(Util.MODEL)) // FireTV 4K
|
||||
&& "OMX.amlogic.avc.decoder.awesome".equals(name);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether the device is known to implement {@link MediaCodec#setOutputSurface(Surface)}
|
||||
* incorrectly.
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ import android.text.style.BackgroundColorSpan;
|
|||
import android.text.style.RelativeSizeSpan;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.android.exoplayer2.text.CaptionStyleCompat;
|
||||
import com.google.android.exoplayer2.text.Cue;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
|
|
@ -257,8 +256,8 @@ import com.google.android.exoplayer2.util.Util;
|
|||
|
||||
if (Color.alpha(backgroundColor) > 0) {
|
||||
SpannableStringBuilder newCueText = new SpannableStringBuilder(cueText);
|
||||
newCueText.setSpan(new BackgroundColorSpan(backgroundColor), 0, newCueText.length(),
|
||||
Spanned.SPAN_PRIORITY);
|
||||
newCueText.setSpan(
|
||||
new BackgroundColorSpan(backgroundColor), 0, newCueText.length(), Spanned.SPAN_PRIORITY);
|
||||
cueText = newCueText;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -206,8 +206,10 @@ public final class SubtitleView extends View implements TextOutput {
|
|||
* {@link CaptioningManager#getUserStyle()}, or to a default style before API level 19.
|
||||
*/
|
||||
public void setUserDefaultStyle() {
|
||||
setStyle(Util.SDK_INT >= 19 && isCaptionManagerEnabled() &&!isInEditMode()
|
||||
? getUserCaptionStyleV19() : CaptionStyleCompat.DEFAULT);
|
||||
setStyle(
|
||||
Util.SDK_INT >= 19 && isCaptionManagerEnabled() && !isInEditMode()
|
||||
? getUserCaptionStyleV19()
|
||||
: CaptionStyleCompat.DEFAULT);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -318,7 +320,7 @@ public final class SubtitleView extends View implements TextOutput {
|
|||
@TargetApi(19)
|
||||
private boolean isCaptionManagerEnabled() {
|
||||
CaptioningManager captioningManager =
|
||||
(CaptioningManager) getContext().getSystemService(Context.CAPTIONING_SERVICE);
|
||||
(CaptioningManager) getContext().getSystemService(Context.CAPTIONING_SERVICE);
|
||||
return captioningManager.isEnabled();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue