faqs.md 3.1 KB
Newer Older
O
ojw28 已提交
1 2 3
---
layout: default
title: FAQs
O
Oliver Woodman 已提交
4
weight: 5
O
ojw28 已提交
5 6
---

O
ojw28 已提交
7 8
* [What formats does ExoPlayer support?][]
* [How do I get smooth animation/scrolling of video?][]
O
ojw28 已提交
9
* [Should I use SurfaceView or TextureView?][]
O
Oliver Woodman 已提交
10
* [Does ExoPlayer support emulators?][]
O
ojw28 已提交
11

O
ojw28 已提交
12 13
---

O
ojw28 已提交
14 15
#### What formats does ExoPlayer support? ####

O
ojw28 已提交
16
See the [Supported formats][] page.
O
ojw28 已提交
17 18 19

#### How do I get smooth animation/scrolling of video? ####

O
Oliver Woodman 已提交
20 21 22 23 24 25
`SurfaceView` rendering wasn't properly synchronized with view animations until
Android N. On earlier releases this could result in unwanted effects when a
`SurfaceView` was placed into scrolling container, or when it was subjected to
animation. Such effects included the `SurfaceView`'s contents appearing to lag
slightly behind where it should be displayed, and the view turning black when
subjected to animation.
O
ojw28 已提交
26

O
Oliver Woodman 已提交
27 28 29 30
To achieve smooth animation or scrolling of video prior to Android N, it's
therefore necessary to use `TextureView` rather than `SurfaceView`. If smooth
animation or scrolling is not required then `SurfaceView` should be preferred
(see [Should I use SurfaceView or TextureView?][]).
O
ojw28 已提交
31 32 33 34 35 36 37 38 39

#### Should I use SurfaceView or TextureView? ####

`SurfaceView` has a number of benefits over `TextureView` for video playback:

* Significantly lower power consumption on many devices.
* More accurate frame timing, resulting in smoother video playback.
* Support for secure output when playing DRM protected content.

O
Oliver Woodman 已提交
40 41 42 43 44 45
`SurfaceView` should therefore be preferred over `TextureView` where possible.
`TextureView` should be used only if `SurfaceView` does not meet your needs. One
example is where smooth animations or scrolling of the video surface is required
prior to Android N (see [How do I get smooth animation/scrolling of video?][]).
For this case, it's preferable to use `TextureView` only when [`SDK_INT`][] is
less than 24 (Android N) and `SurfaceView` otherwise.
O
ojw28 已提交
46

O
Oliver Woodman 已提交
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
#### Does ExoPlayer support emulators? ####

If you're seeing ExoPlayer fail when using an emulator, this is usually because
the emulator does not properly implement components of Android's media stack.
This is an issue with the emulator, not with ExoPlayer. Android's official
emulator ("Virtual Devices" in Android Studio) supports ExoPlayer provided the
system image has an API level of at least 23. System images with earlier API
levels do not support ExoPlayer. The level of support provided by third party
emulators varies. If you find a third party emulator on which ExoPlayer fails,
you should report this to the developer of the emulator rather than to the
ExoPlayer team. Where possible, we recommend testing media applications on
physical devices rather than emulators.

[What formats does ExoPlayer support?]: #what-formats-does-exoplayer-support
[How do I get smooth animation/scrolling of video?]: #how-do-i-get-smooth-animationscrolling-of-video
[Should I use SurfaceView or TextureView?]: #should-i-use-surfaceview-or-textureview
[Does ExoPlayer support emulators?]: #does-exoplayer-support-emulators
O
ojw28 已提交
64 65
[Supported formats]: https://google.github.io/ExoPlayer/supported-formats.html
[`SDK_INT`]: https://developer.android.com/reference/android/os/Build.VERSION.html#SDK_INT