packages
packages copied to clipboard
[video_player] Updated README.md
When I use http (rather than https) connection for the Video Player on Android 9 (API level 28) or higher, I got
Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$CleartextNotPermittedException: Cleartext HTTP traffic not permitted. See https://developer.android.com/guide/topics/media/issues/cleartext-not-permitted
The documentation and plugin description didn't mention this.
If users are targeting Android 9 and above and need to establish an http connection, they should set "android:usesCleartextTraffic = true".
Here is the source of information Android's documentation).
Pre-launch Checklist
- [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
- [x] I read the Tree Hygiene wiki page, which explains my responsibilities.
- [x] I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use
dart format.) - [x] I signed the CLA.
- [x] The title of the PR starts with the name of the package surrounded by square brackets, e.g.
[shared_preferences] - [x] I linked to at least one issue that this PR fixes in the description above.
- [x] I updated
pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes. - [x] I updated
CHANGELOG.mdto add a description of the change, following repository CHANGELOG style. - [x] I updated/added relevant documentation (doc comments with
///). - [x] I added new tests to check the change I am making, or this PR is test-exempt.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel on Discord.
- [x] I linked to at least one issue that this PR fixes in the description above.
I'm not seeing a linked issue. This should have one, because there should be a discussion (looping in stakeholders from the Android team in general) about whether this is even a topic we want to cover in the README.
- [x] I linked to at least one issue that this PR fixes in the description above.
I'm not seeing a linked issue. This should have one, because there should be a discussion (looping in stakeholders from the Android team in general) about whether this is even a topic we want to cover in the README.
I see. When I searched, I didn't find this issue in Flutter's issues. Additionally, in the package descriptions, I noticed HTTP usage mentioned for iOS but not for Android, particularly on newer Android versions. Therefore, I followed the guidance provided in the error log I received and presented the solution accordingly. It's possible that nobody has attempted to use HTTP connections with Android 14. Of course, this is just a hypothesis. I've opened this PR to expedite the process and for your consideration.
I would appreciate it if you could tag individuals from the Android team to address this matter.
Here is my whole error log for better understanding:
E/ExoPlayerImplInternal( 6459): Playback error
E/ExoPlayerImplInternal( 6459): com.google.android.exoplayer2.ExoPlaybackException: Source error
E/ExoPlayerImplInternal( 6459): at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:644)
E/ExoPlayerImplInternal( 6459): at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:616)
E/ExoPlayerImplInternal( 6459): at android.os.Handler.dispatchMessage(Handler.java:102)
E/ExoPlayerImplInternal( 6459): at android.os.Looper.loopOnce(Looper.java:201)
E/ExoPlayerImplInternal( 6459): at android.os.Looper.loop(Looper.java:288)
E/ExoPlayerImplInternal( 6459): at android.os.HandlerThread.run(HandlerThread.java:67)
E/ExoPlayerImplInternal( 6459): Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$CleartextNotPermittedException: Cleartext HTTP traffic not permitted. See https://developer.android.com/guide/topics/media/issues/cleartext-not-permitted
E/ExoPlayerImplInternal( 6459): at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:382)
E/ExoPlayerImplInternal( 6459): at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:263)
E/ExoPlayerImplInternal( 6459): at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84)
E/ExoPlayerImplInternal( 6459): at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1005)
E/ExoPlayerImplInternal( 6459): at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
E/ExoPlayerImplInternal( 6459): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
E/ExoPlayerImplInternal( 6459): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
E/ExoPlayerImplInternal( 6459): at java.lang.Thread.run(Thread.java:1012)
E/ExoPlayerImplInternal( 6459): Caused by: java.io.IOException: Cleartext HTTP traffic to dev.croms.com.tr not permitted
E/ExoPlayerImplInternal( 6459): at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:127)
E/ExoPlayerImplInternal( 6459): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:462)
E/ExoPlayerImplInternal( 6459): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
E/ExoPlayerImplInternal( 6459): at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.makeConnection(DefaultHttpDataSource.java:653)
E/ExoPlayerImplInternal( 6459): at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.makeConnection(DefaultHttpDataSource.java:550)
E/ExoPlayerImplInternal( 6459): at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:376)
E/ExoPlayerImplInternal( 6459): ... 7 more
When I searched, I didn't find this issue in Flutter's issues.
Please see step 2 here.
I would appreciate it if you could tag individuals from the Android team to address this matter.
The place for that discussion is the issue that should be filed, per my previous comment.
Marking as a draft pending an issue being filed for discussion, and a resolution there.
Since this is marked as a draft and hasn't been updated in several months I'm going to close it to clean out our review queue. Please don't hesitate to submit a new PR if you decide to revisit this. Thanks!