1*30877f79SAndroid Build Coastguard Worker--- 2*30877f79SAndroid Build Coastguard Workertitle: Troubleshooting 3*30877f79SAndroid Build Coastguard Workerredirect_from: 4*30877f79SAndroid Build Coastguard Worker - /faqs.html 5*30877f79SAndroid Build Coastguard Worker - /debugging-playback-issues.html 6*30877f79SAndroid Build Coastguard Worker--- 7*30877f79SAndroid Build Coastguard Worker 8*30877f79SAndroid Build Coastguard Worker* [Fixing "Cleartext HTTP traffic not permitted" errors][] 9*30877f79SAndroid Build Coastguard Worker* [Fixing "SSLHandshakeException" and "CertPathValidatorException" errors][] 10*30877f79SAndroid Build Coastguard Worker* [Why are some media files not seekable?][] 11*30877f79SAndroid Build Coastguard Worker* [Why is seeking inaccurate in some MP3 files?][] 12*30877f79SAndroid Build Coastguard Worker* [Why do some MPEG-TS files fail to play?][] 13*30877f79SAndroid Build Coastguard Worker* [Why do some MP4/FMP4 files play incorrectly?][] 14*30877f79SAndroid Build Coastguard Worker* [Why do some streams fail with HTTP response code 301 or 302?][] 15*30877f79SAndroid Build Coastguard Worker* [Why do some streams fail with UnrecognizedInputFormatException?][] 16*30877f79SAndroid Build Coastguard Worker* [Why doesn't setPlaybackParameters work properly on some devices?][] 17*30877f79SAndroid Build Coastguard Worker* [What do "Player is accessed on the wrong thread" errors mean?][] 18*30877f79SAndroid Build Coastguard Worker* [How can I fix "Unexpected status line: ICY 200 OK"?][] 19*30877f79SAndroid Build Coastguard Worker* [How can I query whether the stream being played is a live stream?][] 20*30877f79SAndroid Build Coastguard Worker* [How do I keep audio playing when my app is backgrounded?][] 21*30877f79SAndroid Build Coastguard Worker* [Why does ExoPlayer support my content but the Cast extension doesn't?][] 22*30877f79SAndroid Build Coastguard Worker* [Why does content fail to play, but no error is surfaced?] 23*30877f79SAndroid Build Coastguard Worker* [How can I get a decoding extension to load and be used for playback?][] 24*30877f79SAndroid Build Coastguard Worker* [Can I play YouTube videos directly with ExoPlayer?][] 25*30877f79SAndroid Build Coastguard Worker 26*30877f79SAndroid Build Coastguard Worker--- 27*30877f79SAndroid Build Coastguard Worker 28*30877f79SAndroid Build Coastguard Worker#### Fixing "Cleartext HTTP traffic not permitted" errors #### 29*30877f79SAndroid Build Coastguard Worker 30*30877f79SAndroid Build Coastguard WorkerThis error will occur if your app requests cleartext HTTP traffic (i.e., 31*30877f79SAndroid Build Coastguard Worker`http://` rather than `https://`) when its Network Security Configuration does 32*30877f79SAndroid Build Coastguard Workernot permit it. If your app targets Android 9 (API level 28) or later, cleartext 33*30877f79SAndroid Build Coastguard WorkerHTTP traffic is disabled by the default configuration. 34*30877f79SAndroid Build Coastguard Worker 35*30877f79SAndroid Build Coastguard WorkerIf your app needs to work with cleartext HTTP traffic then you need to use a 36*30877f79SAndroid Build Coastguard WorkerNetwork Security Configuration that permits it. Please see Android's 37*30877f79SAndroid Build Coastguard Worker[network security documentation](https://developer.android.com/training/articles/security-config.html) 38*30877f79SAndroid Build Coastguard Workerfor details. To enable all cleartext HTTP traffic, you can simply add 39*30877f79SAndroid Build Coastguard Worker`android:usesCleartextTraffic="true"` to the `application` element of your app's 40*30877f79SAndroid Build Coastguard Worker`AndroidManifest.xml`. 41*30877f79SAndroid Build Coastguard Worker 42*30877f79SAndroid Build Coastguard WorkerThe ExoPlayer demo app uses the default Network Security Configuration, and so 43*30877f79SAndroid Build Coastguard Workerdoes not allow cleartext HTTP traffic. You can enable it using the instructions 44*30877f79SAndroid Build Coastguard Workerabove. 45*30877f79SAndroid Build Coastguard Worker 46*30877f79SAndroid Build Coastguard Worker#### Fixing "SSLHandshakeException" and "CertPathValidatorException" errors #### 47*30877f79SAndroid Build Coastguard Worker 48*30877f79SAndroid Build Coastguard Worker`SSLHandshakeException` and `CertPathValidatorException` both indicate a problem 49*30877f79SAndroid Build Coastguard Workerwith the server's SSL certificate. These errors are not ExoPlayer specific. 50*30877f79SAndroid Build Coastguard WorkerPlease see 51*30877f79SAndroid Build Coastguard Worker[Android's SSL documentation](https://developer.android.com/training/articles/security-ssl#CommonProblems) 52*30877f79SAndroid Build Coastguard Workerfor more details. 53*30877f79SAndroid Build Coastguard Worker 54*30877f79SAndroid Build Coastguard Worker#### Why are some media files not seekable? #### 55*30877f79SAndroid Build Coastguard Worker 56*30877f79SAndroid Build Coastguard WorkerBy default ExoPlayer does not support seeking in media where the only method for 57*30877f79SAndroid Build Coastguard Workerperforming accurate seek operations is for the player to scan and index the 58*30877f79SAndroid Build Coastguard Workerentire file. ExoPlayer considers such files as unseekable. Most modern media 59*30877f79SAndroid Build Coastguard Workercontainer formats include metadata for seeking (e.g., a sample index), have a 60*30877f79SAndroid Build Coastguard Workerwell defined seek algorithm (e.g., interpolated bisection search for Ogg), or 61*30877f79SAndroid Build Coastguard Workerindicate that their content is constant bitrate. Efficient seek operations are 62*30877f79SAndroid Build Coastguard Workerpossible and supported by ExoPlayer in these cases. 63*30877f79SAndroid Build Coastguard Worker 64*30877f79SAndroid Build Coastguard WorkerIf you require seeking but have unseekable media, we suggest converting your 65*30877f79SAndroid Build Coastguard Workercontent to use a more appropriate container format. For MP3, ADTS and AMR files, 66*30877f79SAndroid Build Coastguard Workeryou can also enable seeking under the assumption that the files have a constant 67*30877f79SAndroid Build Coastguard Workerbitrate, as described 68*30877f79SAndroid Build Coastguard Worker[here](customization.html#enabling-constant-bitrate-seeking). 69*30877f79SAndroid Build Coastguard Worker 70*30877f79SAndroid Build Coastguard Worker#### Why is seeking inaccurate in some MP3 files? #### 71*30877f79SAndroid Build Coastguard Worker 72*30877f79SAndroid Build Coastguard WorkerVariable bitrate (VBR) MP3 files are fundamentally unsuitable for use cases that 73*30877f79SAndroid Build Coastguard Workerrequire exact seeking. There are two reasons for this: 74*30877f79SAndroid Build Coastguard Worker 75*30877f79SAndroid Build Coastguard Worker1. For exact seeking, a container format will ideally provide a precise 76*30877f79SAndroid Build Coastguard Worker time-to-byte mapping in a header. This mapping allows a player to map a 77*30877f79SAndroid Build Coastguard Worker requested seek time to the corresponding byte offset, and start requesting, 78*30877f79SAndroid Build Coastguard Worker parsing and playing media from that offset. The headers available for 79*30877f79SAndroid Build Coastguard Worker specifying this mapping in MP3 (e.g., XING headers) are, unfortunately, often 80*30877f79SAndroid Build Coastguard Worker imprecise. 81*30877f79SAndroid Build Coastguard Worker1. For container formats that don't provide a precise time-to-byte mapping (or 82*30877f79SAndroid Build Coastguard Worker any time-to-byte mapping at all), it's still possible to perform an exact 83*30877f79SAndroid Build Coastguard Worker seek if the container includes absolute sample timestamps in the stream. In 84*30877f79SAndroid Build Coastguard Worker this case a player can map the seek time to a best guess of the corresponding 85*30877f79SAndroid Build Coastguard Worker byte offset, start requesting media from that offset, parse the first 86*30877f79SAndroid Build Coastguard Worker absolute sample timestamp, and effectively perform a guided binary search 87*30877f79SAndroid Build Coastguard Worker into the media until it finds the right sample. Unfortunately MP3 does not 88*30877f79SAndroid Build Coastguard Worker include absolute sample timestamps in the stream, so this approach is not 89*30877f79SAndroid Build Coastguard Worker possible. 90*30877f79SAndroid Build Coastguard Worker 91*30877f79SAndroid Build Coastguard WorkerFor these reasons, the only way to perform an exact seek into a VBR MP3 file is 92*30877f79SAndroid Build Coastguard Workerto scan the entire file and manually build up a time-to-byte mapping in the 93*30877f79SAndroid Build Coastguard Workerplayer. This strategy can be enabled by using [`FLAG_ENABLE_INDEX_SEEKING`][], 94*30877f79SAndroid Build Coastguard Workerwhich can be [set on a `DefaultExtractorsFactory`][] using 95*30877f79SAndroid Build Coastguard Worker[`setMp3ExtractorFlags`][]. Note that it doesn't scale well to large MP3 files, 96*30877f79SAndroid Build Coastguard Workerparticularly if the user tries to seek to near the end of the stream shortly 97*30877f79SAndroid Build Coastguard Workerafter starting playback, which requires the player to wait until it's downloaded 98*30877f79SAndroid Build Coastguard Workerand indexed the entire stream before performing the seek. In ExoPlayer, we 99*30877f79SAndroid Build Coastguard Workerdecided to optimize for speed over accuracy in this case and 100*30877f79SAndroid Build Coastguard Worker[`FLAG_ENABLE_INDEX_SEEKING`][] is therefore disabled by default. 101*30877f79SAndroid Build Coastguard Worker 102*30877f79SAndroid Build Coastguard WorkerIf you control the media you're playing, we strongly advise that you use a more 103*30877f79SAndroid Build Coastguard Workerappropriate container format, such as MP4. There are no use cases we're aware of 104*30877f79SAndroid Build Coastguard Workerwhere MP3 is the best choice of media format. 105*30877f79SAndroid Build Coastguard Worker 106*30877f79SAndroid Build Coastguard Worker#### Why do some MPEG-TS files fail to play? #### 107*30877f79SAndroid Build Coastguard Worker 108*30877f79SAndroid Build Coastguard WorkerSome MPEG-TS files do not contain access unit delimiters (AUDs). By default 109*30877f79SAndroid Build Coastguard WorkerExoPlayer relies on AUDs to cheaply detect frame boundaries. Similarly, some 110*30877f79SAndroid Build Coastguard WorkerMPEG-TS files do not contain IDR keyframes. By default these are the only type 111*30877f79SAndroid Build Coastguard Workerof keyframes considered by ExoPlayer. 112*30877f79SAndroid Build Coastguard Worker 113*30877f79SAndroid Build Coastguard WorkerExoPlayer will appear to be stuck in the buffering state when asked to play an 114*30877f79SAndroid Build Coastguard WorkerMPEG-TS file that lacks AUDs or IDR keyframes. If you need to play such files, 115*30877f79SAndroid Build Coastguard Workeryou can do so using [`FLAG_DETECT_ACCESS_UNITS`][] and 116*30877f79SAndroid Build Coastguard Worker[`FLAG_ALLOW_NON_IDR_KEYFRAMES`][] respectively. These flags can be [set on a 117*30877f79SAndroid Build Coastguard Worker`DefaultExtractorsFactory`][] using [`setTsExtractorFlags`][] or on a 118*30877f79SAndroid Build Coastguard Worker`DefaultHlsExtractorFactory` using the 119*30877f79SAndroid Build Coastguard Worker[constructor]({{ site.exo_sdk }}/source/hls/DefaultHlsExtractorFactory.html#DefaultHlsExtractorFactory-int-boolean-). 120*30877f79SAndroid Build Coastguard WorkerUse of `FLAG_DETECT_ACCESS_UNITS` has no side effects other than being 121*30877f79SAndroid Build Coastguard Workercomputationally expensive relative to AUD based frame boundary detection. Use of 122*30877f79SAndroid Build Coastguard Worker`FLAG_ALLOW_NON_IDR_KEYFRAMES` may result in temporary visual corruption at the 123*30877f79SAndroid Build Coastguard Workerstart of playback and immediately after seeks when playing some MPEG-TS files. 124*30877f79SAndroid Build Coastguard Worker 125*30877f79SAndroid Build Coastguard Worker#### Why do some MP4/FMP4 files play incorrectly? #### 126*30877f79SAndroid Build Coastguard Worker 127*30877f79SAndroid Build Coastguard WorkerSome MP4/FMP4 files contain edit lists that rewrite the media timeline by 128*30877f79SAndroid Build Coastguard Workerskipping, moving or repeating lists of samples. ExoPlayer has partial support 129*30877f79SAndroid Build Coastguard Workerfor applying edit lists. For example, it can delay or repeat groups of samples 130*30877f79SAndroid Build Coastguard Workerstarting on a synchronization sample, but it does not truncate audio samples or 131*30877f79SAndroid Build Coastguard Workerpreroll media for edits that don't start on a synchronization sample. 132*30877f79SAndroid Build Coastguard Worker 133*30877f79SAndroid Build Coastguard WorkerIf you are seeing that part of the media is unexpectedly missing or repeated, 134*30877f79SAndroid Build Coastguard Workertry setting [`Mp4Extractor.FLAG_WORKAROUND_IGNORE_EDIT_LISTS`][] or 135*30877f79SAndroid Build Coastguard Worker[`FragmentedMp4Extractor.FLAG_WORKAROUND_IGNORE_EDIT_LISTS`][], which will cause 136*30877f79SAndroid Build Coastguard Workerthe extractor to ignore edit lists entirely. These can be [set on a 137*30877f79SAndroid Build Coastguard Worker`DefaultExtractorsFactory`][] using [`setMp4ExtractorFlags`][] or 138*30877f79SAndroid Build Coastguard Worker[`setFragmentedMp4ExtractorFlags`][]. 139*30877f79SAndroid Build Coastguard Worker 140*30877f79SAndroid Build Coastguard Worker#### Why do some streams fail with HTTP response code 301 or 302? #### 141*30877f79SAndroid Build Coastguard Worker 142*30877f79SAndroid Build Coastguard WorkerHTTP response codes 301 and 302 both indicate redirection. Brief descriptions 143*30877f79SAndroid Build Coastguard Workercan be found on [Wikipedia][]. When ExoPlayer makes a request and receives a 144*30877f79SAndroid Build Coastguard Workerresponse with status code 301 or 302, it will normally follow the redirect 145*30877f79SAndroid Build Coastguard Workerand start playback as normal. The one case where this does not happen by default 146*30877f79SAndroid Build Coastguard Workeris for cross-protocol redirects. A cross-protocol redirect is one that redirects 147*30877f79SAndroid Build Coastguard Workerfrom HTTPS to HTTP or vice-versa (or less commonly, between another pair of 148*30877f79SAndroid Build Coastguard Workerprotocols). You can test whether a URL causes a cross-protocol redirect using 149*30877f79SAndroid Build Coastguard Workerthe [wget][] command line tool as follows: 150*30877f79SAndroid Build Coastguard Worker``` 151*30877f79SAndroid Build Coastguard Workerwget "https://yourserver.com/test.mp3" 2>&1 | grep Location 152*30877f79SAndroid Build Coastguard Worker``` 153*30877f79SAndroid Build Coastguard WorkerThe output should look something like this: 154*30877f79SAndroid Build Coastguard Worker``` 155*30877f79SAndroid Build Coastguard Worker$ wget "https://yourserver.com/test.mp3" 2>&1 | grep Location 156*30877f79SAndroid Build Coastguard WorkerLocation: https://second.com/test.mp3 [following] 157*30877f79SAndroid Build Coastguard WorkerLocation: http://third.com/test.mp3 [following] 158*30877f79SAndroid Build Coastguard Worker``` 159*30877f79SAndroid Build Coastguard WorkerIn this example there are two redirects. The first redirect is from 160*30877f79SAndroid Build Coastguard Worker`https://yourserver.com/test.mp3` to `https://second.com/test.mp3`. Both are 161*30877f79SAndroid Build Coastguard WorkerHTTPS, and so this is not a cross-protocol redirect. The second redirect is from 162*30877f79SAndroid Build Coastguard Worker`https://second.com/test.mp3` to `http://third.com/test.mp3`. This redirects 163*30877f79SAndroid Build Coastguard Workerfrom HTTPS to HTTP and so is a cross-protocol redirect. ExoPlayer will not 164*30877f79SAndroid Build Coastguard Workerfollow this redirect in its default configuration, meaning playback will fail. 165*30877f79SAndroid Build Coastguard Worker 166*30877f79SAndroid Build Coastguard WorkerIf you need to, you can configure ExoPlayer to follow cross-protocol redirects 167*30877f79SAndroid Build Coastguard Workerwhen instantiating `DefaultHttpDataSourceFactory` instances used in your 168*30877f79SAndroid Build Coastguard Workerapplication. Learn about selecting and configuring the network stack 169*30877f79SAndroid Build Coastguard Worker[here]({{ site.base_url }}/customization.html#configuring-the-network-stack). 170*30877f79SAndroid Build Coastguard Worker 171*30877f79SAndroid Build Coastguard Worker#### Why do some streams fail with UnrecognizedInputFormatException? #### 172*30877f79SAndroid Build Coastguard Worker 173*30877f79SAndroid Build Coastguard WorkerThis question relates to playback failures of the form: 174*30877f79SAndroid Build Coastguard Worker``` 175*30877f79SAndroid Build Coastguard WorkerUnrecognizedInputFormatException: None of the available extractors 176*30877f79SAndroid Build Coastguard Worker(MatroskaExtractor, FragmentedMp4Extractor, ...) could read the stream. 177*30877f79SAndroid Build Coastguard Worker``` 178*30877f79SAndroid Build Coastguard WorkerThere are two possible causes of this failure. The most common cause is that 179*30877f79SAndroid Build Coastguard Workeryou're trying to play DASH (mpd), HLS (m3u8) or SmoothStreaming (ism, isml) 180*30877f79SAndroid Build Coastguard Workercontent, but the player tries to play it as a progressive stream. To play such 181*30877f79SAndroid Build Coastguard Workerstreams, you must depend on the respective [ExoPlayer module][]. In cases where 182*30877f79SAndroid Build Coastguard Workerthe stream URI doesn't end with the standard file extension, you can also pass 183*30877f79SAndroid Build Coastguard Worker`MimeTypes.APPLICATION_MPD`, `MimeTypes.APPLICATION_M3U8` or 184*30877f79SAndroid Build Coastguard Worker`MimeTypes.APPLICATION_SS` to `setMimeType` of `MediaItem.Builder` to explicitly 185*30877f79SAndroid Build Coastguard Workerspecify the type of stream. 186*30877f79SAndroid Build Coastguard Worker 187*30877f79SAndroid Build Coastguard WorkerThe second, less common cause, is that ExoPlayer does not support the container 188*30877f79SAndroid Build Coastguard Workerformat of the media that you're trying to play. In this case the failure is 189*30877f79SAndroid Build Coastguard Workerworking as intended, however feel free to submit a feature request to our 190*30877f79SAndroid Build Coastguard Worker[issue tracker][], including details of the container format and a test stream. 191*30877f79SAndroid Build Coastguard WorkerPlease search for an existing feature request before submitting a new one. 192*30877f79SAndroid Build Coastguard Worker 193*30877f79SAndroid Build Coastguard Worker#### Why doesn't setPlaybackParameters work properly on some devices? #### 194*30877f79SAndroid Build Coastguard Worker 195*30877f79SAndroid Build Coastguard WorkerWhen running a debug build of your app on Android M and earlier, you may 196*30877f79SAndroid Build Coastguard Workerexperience choppy performance, audible artifacts and high CPU utilization when 197*30877f79SAndroid Build Coastguard Workerusing the [`setPlaybackParameters`][] API. This is because an optimization 198*30877f79SAndroid Build Coastguard Workerthat's important to this API is disabled for debug builds running on these 199*30877f79SAndroid Build Coastguard Workerversions of Android. 200*30877f79SAndroid Build Coastguard Worker 201*30877f79SAndroid Build Coastguard WorkerIt's important to note that this issue affects debug builds only. It does *not* 202*30877f79SAndroid Build Coastguard Workeraffect release builds, for which the optimization is always enabled. Hence the 203*30877f79SAndroid Build Coastguard Workerreleases you provide to end users should not be affected by this issue. 204*30877f79SAndroid Build Coastguard Worker 205*30877f79SAndroid Build Coastguard Worker#### What do "Player is accessed on the wrong thread" errors mean? #### 206*30877f79SAndroid Build Coastguard Worker 207*30877f79SAndroid Build Coastguard WorkerSee [A note on threading][] on the getting started page. 208*30877f79SAndroid Build Coastguard Worker 209*30877f79SAndroid Build Coastguard Worker#### How can I fix "Unexpected status line: ICY 200 OK"? #### 210*30877f79SAndroid Build Coastguard Worker 211*30877f79SAndroid Build Coastguard WorkerThis problem can occur if the server response includes an ICY status line, 212*30877f79SAndroid Build Coastguard Workerrather than one that's HTTP compliant. ICY status lines are deprecated and 213*30877f79SAndroid Build Coastguard Workershould not be used, so if you control the server you should update it to provide 214*30877f79SAndroid Build Coastguard Workeran HTTP compliant response. If you're unable to do this then using the 215*30877f79SAndroid Build Coastguard Worker[OkHttp extension][] will resolve the problem, since it's able to handle ICY 216*30877f79SAndroid Build Coastguard Workerstatus lines correctly. 217*30877f79SAndroid Build Coastguard Worker 218*30877f79SAndroid Build Coastguard Worker#### How can I query whether the stream being played is a live stream? #### 219*30877f79SAndroid Build Coastguard Worker 220*30877f79SAndroid Build Coastguard WorkerYou can query the player's [`isCurrentWindowLive`][] method. In addition, you 221*30877f79SAndroid Build Coastguard Workercan check [`isCurrentWindowDynamic`][] to find out whether the window is dynamic 222*30877f79SAndroid Build Coastguard Worker(i.e., still updating over time). 223*30877f79SAndroid Build Coastguard Worker 224*30877f79SAndroid Build Coastguard Worker#### How do I keep audio playing when my app is backgrounded? #### 225*30877f79SAndroid Build Coastguard Worker 226*30877f79SAndroid Build Coastguard WorkerThere are a few steps that you need to take to ensure continued playback of 227*30877f79SAndroid Build Coastguard Workeraudio when your app is in the background: 228*30877f79SAndroid Build Coastguard Worker 229*30877f79SAndroid Build Coastguard Worker1. You need to have a running [foreground service][]. This prevents the system 230*30877f79SAndroid Build Coastguard Worker from killing your process to free up resources. 231*30877f79SAndroid Build Coastguard Worker1. You need to hold a [`WifiLock`][] and a [`WakeLock`][]. These ensure that the 232*30877f79SAndroid Build Coastguard Worker system keeps the WiFi radio and CPU awake. This can be easily done if using 233*30877f79SAndroid Build Coastguard Worker [`ExoPlayer`][] by calling [`setWakeMode`][], which will automatically 234*30877f79SAndroid Build Coastguard Worker acquire and release the required locks at the correct times. 235*30877f79SAndroid Build Coastguard Worker 236*30877f79SAndroid Build Coastguard WorkerIt's important that you release the locks (if not using `setWakeMode`) and stop 237*30877f79SAndroid Build Coastguard Workerthe service as soon as audio is no longer being played. 238*30877f79SAndroid Build Coastguard Worker 239*30877f79SAndroid Build Coastguard Worker#### Why does ExoPlayer support my content but the Cast extension doesn't? #### 240*30877f79SAndroid Build Coastguard Worker 241*30877f79SAndroid Build Coastguard WorkerIt's possible that the content that you are trying to play is not 242*30877f79SAndroid Build Coastguard Worker[CORS enabled][]. The [Cast framework][] requires content to be CORS enabled in 243*30877f79SAndroid Build Coastguard Workerorder to play it. 244*30877f79SAndroid Build Coastguard Worker 245*30877f79SAndroid Build Coastguard Worker#### Why does content fail to play, but no error is surfaced? #### 246*30877f79SAndroid Build Coastguard Worker 247*30877f79SAndroid Build Coastguard WorkerIt's possible that the device on which you are playing the content does not 248*30877f79SAndroid Build Coastguard Workersupport a specific media sample format. This can be easily confirmed by adding 249*30877f79SAndroid Build Coastguard Workeran [`EventLogger`][] as a listener to your player, and looking for a line 250*30877f79SAndroid Build Coastguard Workersimilar to this one in Logcat: 251*30877f79SAndroid Build Coastguard Worker``` 252*30877f79SAndroid Build Coastguard Worker[ ] Track:x, id=x, mimeType=mime/type, ... , supported=NO_UNSUPPORTED_TYPE 253*30877f79SAndroid Build Coastguard Worker``` 254*30877f79SAndroid Build Coastguard Worker`NO_UNSUPPORTED_TYPE` means that the device is not able to decode the media 255*30877f79SAndroid Build Coastguard Workersample format specified by the `mimeType`. See the [Android media formats 256*30877f79SAndroid Build Coastguard Workerdocumentation][] for information about supported sample formats. [How can I get 257*30877f79SAndroid Build Coastguard Workera decoding extension to load and be used for playback?] may also be useful. 258*30877f79SAndroid Build Coastguard Worker 259*30877f79SAndroid Build Coastguard Worker#### How can I get a decoding extension to load and be used for playback? #### 260*30877f79SAndroid Build Coastguard Worker 261*30877f79SAndroid Build Coastguard Worker* Most extensions have manual steps to check out and build the dependencies, so 262*30877f79SAndroid Build Coastguard Worker make sure you've followed the steps in the README for the relevant extension. 263*30877f79SAndroid Build Coastguard Worker For example, for the FFmpeg extension it's necessary to follow the 264*30877f79SAndroid Build Coastguard Worker instructions in [extensions/ffmpeg/README.md][], including passing 265*30877f79SAndroid Build Coastguard Worker configuration flags to [enable decoders][] for the format(s) you want to play. 266*30877f79SAndroid Build Coastguard Worker* For extensions that have native code, make sure you're using the correct 267*30877f79SAndroid Build Coastguard Worker version of the Android NDK as specified in the README, and look out for any 268*30877f79SAndroid Build Coastguard Worker errors that appear during configuration and building. You should see `.so` 269*30877f79SAndroid Build Coastguard Worker files appear in the `libs` subdirectory of the extension's path for each 270*30877f79SAndroid Build Coastguard Worker supported architecture after following the steps in the README. 271*30877f79SAndroid Build Coastguard Worker* To try out playback using the extension in the [demo application][], see 272*30877f79SAndroid Build Coastguard Worker [enabling extension decoders][]. See the README for the extension for 273*30877f79SAndroid Build Coastguard Worker instructions on using the extension from your own app. 274*30877f79SAndroid Build Coastguard Worker* If you're using [`DefaultRenderersFactory`][], you should see an info-level 275*30877f79SAndroid Build Coastguard Worker log line like "Loaded FfmpegAudioRenderer" in Logcat when the extension loads. 276*30877f79SAndroid Build Coastguard Worker If that's missing, make sure the application has a dependency on the 277*30877f79SAndroid Build Coastguard Worker extension. 278*30877f79SAndroid Build Coastguard Worker* If you see warning-level logs from [`LibraryLoader`][] in Logcat, this 279*30877f79SAndroid Build Coastguard Worker indicates that loading the native component of the extension failed. If this 280*30877f79SAndroid Build Coastguard Worker happens, check you've followed the steps in the extension's README correctly 281*30877f79SAndroid Build Coastguard Worker and that no errors were output while following the instructions. 282*30877f79SAndroid Build Coastguard Worker 283*30877f79SAndroid Build Coastguard WorkerIf you're still experiencing problems using extensions, please check the 284*30877f79SAndroid Build Coastguard WorkerExoPlayer [issue tracker][] for any relevant recent issues. If you need to file 285*30877f79SAndroid Build Coastguard Workera new issue and it relates to building the native part of the extension, please 286*30877f79SAndroid Build Coastguard Workerinclude full command line output from running README instructions, to help us 287*30877f79SAndroid Build Coastguard Workerdiagnose the issue. 288*30877f79SAndroid Build Coastguard Worker 289*30877f79SAndroid Build Coastguard Worker#### Can I play YouTube videos directly with ExoPlayer? #### 290*30877f79SAndroid Build Coastguard Worker 291*30877f79SAndroid Build Coastguard WorkerNo, ExoPlayer cannot play videos from YouTube, i.e., urls of the form 292*30877f79SAndroid Build Coastguard Worker`https://www.youtube.com/watch?v=...`. Instead, you should use the [YouTube 293*30877f79SAndroid Build Coastguard WorkerAndroid Player API](https://developers.google.com/youtube/android/player/) which 294*30877f79SAndroid Build Coastguard Workeris the official way to play YouTube videos on Android. 295*30877f79SAndroid Build Coastguard Worker 296*30877f79SAndroid Build Coastguard Worker[Fixing "Cleartext HTTP traffic not permitted" errors]: #fixing-cleartext-http-traffic-not-permitted-errors 297*30877f79SAndroid Build Coastguard Worker[Fixing "SSLHandshakeException" and "CertPathValidatorException" errors]: #fixing-sslhandshakeexception-and-certpathvalidatorexception-errors 298*30877f79SAndroid Build Coastguard Worker[What formats does ExoPlayer support?]: #what-formats-does-exoplayer-support 299*30877f79SAndroid Build Coastguard Worker[Why are some media files not seekable?]: #why-are-some-media-files-not-seekable 300*30877f79SAndroid Build Coastguard Worker[Why is seeking inaccurate in some MP3 files?]: #why-is-seeking-inaccurate-in-some-mp3-files 301*30877f79SAndroid Build Coastguard Worker[Why do some MPEG-TS files fail to play?]: #why-do-some-mpeg-ts-files-fail-to-play 302*30877f79SAndroid Build Coastguard Worker[Why do some MP4/FMP4 files play incorrectly?]: #why-do-some-mp4fmp4-files-play-incorrectly 303*30877f79SAndroid Build Coastguard Worker[Why do some streams fail with HTTP response code 301 or 302?]: #why-do-some-streams-fail-with-http-response-code-301-or-302 304*30877f79SAndroid Build Coastguard Worker[Why do some streams fail with UnrecognizedInputFormatException?]: #why-do-some-streams-fail-with-unrecognizedinputformatexception 305*30877f79SAndroid Build Coastguard Worker[Why doesn't setPlaybackParameters work properly on some devices?]: #why-doesnt-setplaybackparameters-work-properly-on-some-devices 306*30877f79SAndroid Build Coastguard Worker[What do "Player is accessed on the wrong thread" errors mean?]: #what-do-player-is-accessed-on-the-wrong-thread-errors-mean 307*30877f79SAndroid Build Coastguard Worker[How can I fix "Unexpected status line: ICY 200 OK"?]: #how-can-i-fix-unexpected-status-line-icy-200-ok 308*30877f79SAndroid Build Coastguard Worker[How can I query whether the stream being played is a live stream?]: #how-can-i-query-whether-the-stream-being-played-is-a-live-stream 309*30877f79SAndroid Build Coastguard Worker[How do I keep audio playing when my app is backgrounded?]: #how-do-i-keep-audio-playing-when-my-app-is-backgrounded 310*30877f79SAndroid Build Coastguard Worker[Why does ExoPlayer support my content but the Cast extension doesn't?]: #why-does-exoplayer-support-my-content-but-the-cast-extension-doesnt 311*30877f79SAndroid Build Coastguard Worker[Why does content fail to play, but no error is surfaced?]: #why-does-content-fail-to-play-but-no-error-is-surfaced 312*30877f79SAndroid Build Coastguard Worker[How can I get a decoding extension to load and be used for playback?]: #how-can-i-get-a-decoding-extension-to-load-and-be-used-for-playback 313*30877f79SAndroid Build Coastguard Worker[Can I play YouTube videos directly with ExoPlayer?]: #can-i-play-youtube-videos-directly-with-exoplayer 314*30877f79SAndroid Build Coastguard Worker 315*30877f79SAndroid Build Coastguard Worker 316*30877f79SAndroid Build Coastguard Worker[Supported formats]: {{ site.baseurl }}/supported-formats.html 317*30877f79SAndroid Build Coastguard Worker[set on a `DefaultExtractorsFactory`]: {{ site.base_url }}/customization.html#customizing-extractor-flags 318*30877f79SAndroid Build Coastguard Worker[`setMp3ExtractorFlags`]: {{ site.exo_sdk }}/extractor/DefaultExtractorsFactory#setMp3ExtractorFlags(int) 319*30877f79SAndroid Build Coastguard Worker[`FLAG_ENABLE_INDEX_SEEKING`]: {{ site.exo_sdk }}/extractor/mp3/Mp3Extractor.html#FLAG_ENABLE_INDEX_SEEKING 320*30877f79SAndroid Build Coastguard Worker[`FLAG_DETECT_ACCESS_UNITS`]: {{ site.exo_sdk }}/extractor/ts/DefaultTsPayloadReaderFactory.html#FLAG_DETECT_ACCESS_UNITS 321*30877f79SAndroid Build Coastguard Worker[`FLAG_ALLOW_NON_IDR_KEYFRAMES`]: {{ site.exo_sdk }}/extractor/ts/DefaultTsPayloadReaderFactory.html#FLAG_ALLOW_NON_IDR_KEYFRAMES 322*30877f79SAndroid Build Coastguard Worker[`setTsExtractorFlags`]: {{ site.exo_sdk }}/extractor/DefaultExtractorsFactory#setTsExtractorFlags(int) 323*30877f79SAndroid Build Coastguard Worker[`Mp4Extractor.FLAG_WORKAROUND_IGNORE_EDIT_LISTS`]: {{ site.exo_sdk }}/extractor/mp4/Mp4Extractor.html#FLAG_WORKAROUND_IGNORE_EDIT_LISTS 324*30877f79SAndroid Build Coastguard Worker[`FragmentedMp4Extractor.FLAG_WORKAROUND_IGNORE_EDIT_LISTS`]: {{ site.exo_sdk }}/extractor/mp4/FragmentedMp4Extractor.html#FLAG_WORKAROUND_IGNORE_EDIT_LISTS 325*30877f79SAndroid Build Coastguard Worker[`setMp4ExtractorFlags`]: {{ site.exo_sdk }}/extractor/DefaultExtractorsFactory#setMp4ExtractorFlags(int) 326*30877f79SAndroid Build Coastguard Worker[`setFragmentedMp4ExtractorFlags`]: {{ site.exo_sdk }}/extractor/DefaultExtractorsFactory#setFragmentedMp4ExtractorFlags(int) 327*30877f79SAndroid Build Coastguard Worker[Wikipedia]: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes 328*30877f79SAndroid Build Coastguard Worker[wget]: https://www.gnu.org/software/wget/manual/wget.html 329*30877f79SAndroid Build Coastguard Worker[`DefaultHttpDataSourceFactory`]: {{ site.exo_sdk }}/upstream/DefaultHttpDataSourceFactory.html 330*30877f79SAndroid Build Coastguard Worker[ExoPlayer module]: {{ site.base_url }}/hello-world.html#add-exoplayer-modules 331*30877f79SAndroid Build Coastguard Worker[issue tracker]: https://github.com/google/ExoPlayer/issues 332*30877f79SAndroid Build Coastguard Worker[`isCurrentWindowLive`]: {{ site.exo_sdk }}/Player.html#isCurrentWindowLive() 333*30877f79SAndroid Build Coastguard Worker[`isCurrentWindowDynamic`]: {{ site.exo_sdk }}/Player.html#isCurrentWindowDynamic() 334*30877f79SAndroid Build Coastguard Worker[`setPlaybackParameters`]: {{ site.exo_sdk }}/Player.html#setPlaybackParameters(com.google.android.exoplayer2.PlaybackParameters) 335*30877f79SAndroid Build Coastguard Worker[foreground service]: https://developer.android.com/guide/components/services.html#Foreground 336*30877f79SAndroid Build Coastguard Worker[`WifiLock`]: {{ site.android_sdk }}/android/net/wifi/WifiManager.WifiLock.html 337*30877f79SAndroid Build Coastguard Worker[`WakeLock`]: {{ site.android_sdk }}/android/os/PowerManager.WakeLock.html 338*30877f79SAndroid Build Coastguard Worker[`ExoPlayer`]: {{ site.exo_sdk }}/ExoPlayer.html 339*30877f79SAndroid Build Coastguard Worker[`setWakeMode`]: {{ site.exo_sdk }}/ExoPlayer.html#setWakeMode(int) 340*30877f79SAndroid Build Coastguard Worker[A note on threading]: {{ site.base_url }}/hello-world.html#a-note-on-threading 341*30877f79SAndroid Build Coastguard Worker[OkHttp extension]: {{ site.release_v2 }}/extensions/okhttp 342*30877f79SAndroid Build Coastguard Worker[CORS enabled]: https://www.w3.org/wiki/CORS_Enabled 343*30877f79SAndroid Build Coastguard Worker[Cast framework]: {{ site.google_sdk }}/cast/docs/chrome_sender/advanced#cors_requirements 344*30877f79SAndroid Build Coastguard Worker[Android media formats documentation]: https://developer.android.com/guide/topics/media/media-formats#core 345*30877f79SAndroid Build Coastguard Worker[extensions/ffmpeg/README.md]: {{ site.release_v2 }}/extensions/ffmpeg/README.md 346*30877f79SAndroid Build Coastguard Worker[enable decoders]: {{ site.base_url }}/supported-formats.html#ffmpeg-extension 347*30877f79SAndroid Build Coastguard Worker[demo application]: {{ site.base_url }}/demo-application.html 348*30877f79SAndroid Build Coastguard Worker[enabling extension decoders]: {{ site.base_url }}/demo-application.html#enabling-extension-decoders 349*30877f79SAndroid Build Coastguard Worker[`DefaultRenderersFactory`]: {{ site.exo_sdk }}/DefaultRenderersFactory.html 350*30877f79SAndroid Build Coastguard Worker[`LibraryLoader`]: {{ site.exo_sdk }}/util/LibraryLoader.html 351*30877f79SAndroid Build Coastguard Worker[`EventLogger`]: {{ site.baseurl }}/debug-logging.html 352