Android Instant apps play video fail, show "Can't play this video."

0

(Instant apps can play video normally use webview, but videoview fail.

Use Android Videoview play video, The APK can play normally, but the Instant apps can not play. show error: Can't play this video.

java code:

Uri uri = Uri.parse("https://v1-tt.ixigua.com/40f0bfa756a159d27864bb70aeabdb8b/59f457f6/video/m/22033a84279cb1145a8bafee6279724505b1151dcf0000063157252c98c/");
VideoView videoView = (VideoView) findViewById(R.id.videoView);
videoView.setVideoURI(uri);
videoView.start();

logcat show:

10-28 06:31:01.952 21522-21522/? W/MediaPlayer: Couldn't open https://v1-tt.ixigua.com/40f0bfa756a159d27864bb70aeabdb8b/59f457f6/video/m/22033a84279cb1145a8bafee6279724505b1151dcf0000063157252c98c/: java.io.FileNotFoundException: No content provider: https://v1-tt.ixigua.com/40f0bfa756a159d27864bb70aeabdb8b/59f457f6/video/m/22033a84279cb1145a8bafee6279724505b1151dcf0000063157252c98c/ 10-28 06:31:01.953 21522-21522/? V/MediaHTTPService: MediaHTTPService(android.media.MediaHTTPService@79aba57): Cookies: null 10-28 06:31:01.954 21522-21522/? E/MediaPlayerNative: Unable to create media player 10-28 06:31:01.958 21522-21522/? W/VideoView: Unable to open content: https://v1-tt.ixigua.com/40f0bfa756a159d27864bb70aeabdb8b/59f457f6/video/m/22033a84279cb1145a8bafee6279724505b1151dcf0000063157252c98c/ java.io.IOException: setDataSource failed.: status=0x80000000 at android.media.MediaPlayer.nativeSetDataSource(Native Method) at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1153) at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1141) at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1059) at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1080) at android.widget.VideoView.openVideo(VideoView.java:399) at android.widget.VideoView.-wrap0(Unknown Source:0) at android.widget.VideoView$7.surfaceCreated(VideoView.java:678) at android.view.SurfaceView.updateSurface(SurfaceView.java:664) at android.view.SurfaceView$2.onPreDraw(SurfaceView.java:143) at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:977) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2337) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1386) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6733) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911) at android.view.Choreographer.doCallbacks(Choreographer.java:723) at android.view.Choreographer.doFrame(Choreographer.java:658) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897) at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6541) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 10-28 06:31:01.958 21522-21522/? D/VideoView: Error: 1,0

android-videoview
android-instant-apps
asked on Stack Overflow Oct 28, 2017 by m41m41 • edited Feb 18, 2020 by Ajeett

1 Answer

1

The error does not seem to be related to Android Instant Apps, since playing a video in this manner works.

I'm getting a 403 error when trying to access the video you provided.

Make sure that accessing the video's file access is correct for the app's user.

answered on Stack Overflow Oct 30, 2017 by keyboardsurfer

User contributions licensed under CC BY-SA 3.0