Guides

Android Studio Tutorial – Streaming Video



Link Donate : https://paypal.me/edmtdev

Facebook : http://facebook.com/edmtdev

In this tutorial, you will learn how to stream a remote video by using a MediaController and display it into a VideoView in your Android Application.

video streaming ,
streaming video,
android development tutorial,
android programming tutorial,
android app development tutorial,
android tutorial for beginners ,
android app tutoria,
android studio tutorial,
learn android programming ,
android developer tutorial ,
android programming,
android development,
android studio tutorial for beginners,
android course,
android training,
android development course,
android app development course

49 Comments

  • John Portelance

    I have tried different web links including yours and also a link you provided another viewer below and still got this message:

    10/13 20:59:09: Launching 'app' on Pixel 2 API 29.

    $ adb shell am start -n "com.example.videostreaming/com.example.videostreaming.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER

    Waiting for process to come online…

    Connected to process 4426 on device 'emulator-5554'.

    Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.

    D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.

    W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)

    D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so

    D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so

    D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so

    W/.videostreamin: Verification of android.content.Context androidx.appcompat.app.AppCompatViewInflater.themifyContext(android.content.Context, android.util.AttributeSet, boolean, boolean) took 110.019ms

    W/.videostreamin: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)

    W/.videostreamin: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)

    D/HostConnection: HostConnection::get() New Host Connection established 0xdc5c93c0, tid 4460

    D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0

    D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 0 0

    D/EGL_emulation: eglCreateContext: 0xebbb3620: maj 3 min 0 rcv 3

    D/EGL_emulation: eglMakeCurrent: 0xebbb3620: ver 3 0 (tinfo 0xf2d98ce0)

    W/Gralloc3: mapper 3.x is not supported

    D/HostConnection: createUnique: call

    D/HostConnection: HostConnection::get() New Host Connection established 0xdc5cdc40, tid 4460

    HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0

    D/eglCodecCommon: allocate: Ask for block of size 0x1000

    allocate: ioctl allocate returned offset 0x3ffff4000 size 0x2000

    D/EGL_emulation: eglMakeCurrent: 0xebbb3620: ver 3 0 (tinfo 0xf2d98ce0)

    D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 1 0

    I/OpenGLRenderer: Davey! duration=2396ms; Flags=1, IntendedVsync=212684034130, Vsync=212784034126, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=212794247000, AnimationStart=212794369000, PerformTraversalsStart=212794492300, DrawStart=213035621200, SyncQueued=213038933000, SyncStart=213039966100, IssueDrawCommandsStart=213040472900, SwapBuffers=214603390700, FrameCompleted=215081701400, DequeueBufferDuration=74353000, QueueBufferDuration=421000,

    I/Choreographer: Skipped 136 frames! The application may be doing too much work on its main thread.

    W/RenderThread: type=1400 audit(0.0:17): avc: denied { write } for name="property_service" dev="tmpfs" ino=6750 scontext=u:r:untrusted_app:s0:c135,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0

    W/MediaPlayer: Couldn't open https://content.jwplatform.com/

    java.io.FileNotFoundException: No content provider: https://content.jwplatform.com/manifests/yp34SRmf.m3u8.mp4

    at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1673)

    at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1503)

    at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1420)

    at android.media.MediaPlayer.attemptDataSource(MediaPlayer.java:1101)

    at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1073)

    at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1097)

    at android.widget.VideoView.openVideo(VideoView.java:412)

    at android.widget.VideoView.setVideoURI(VideoView.java:287)

    at android.widget.VideoView.setVideoURI(VideoView.java:270)

    at com.example.videostreaming.MainActivity.onClick(MainActivity.java:44)

    at android.view.View.performClick(View.java:7125)

    at android.view.View.performClickInternal(View.java:7102)

    at android.view.View.access$3500(View.java:801)

    at android.view.View$PerformClick.run(View.java:27336)

    at android.os.Handler.handleCallback(Handler.java:883)

    at android.os.Handler.dispatchMessage(Handler.java:100)

    at android.os.Looper.loop(Looper.java:214)

    at android.app.ActivityThread.main(ActivityThread.java:7356)

    at java.lang.reflect.Method.invoke(Native Method)

    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)

    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

    V/MediaHTTPService: MediaHTTPService(android.media.MediaHTTPService@991ea7c): Cookies: null

    D/EGL_emulation: eglMakeCurrent: 0xebbb3620: ver 3 0 (tinfo 0xf2d98ce0)

    V/MediaHTTPService: makeHTTPConnection: CookieManager created: java.net.CookieManager@145e680

    makeHTTPConnection(android.media.MediaHTTPService@991ea7c): cookieHandler: java.net.CookieManager@145e680 Cookies: null

    W/.videostreamin: Verification of void com.android.org.conscrypt.AbstractSessionContext.setSessionCacheSize(int) took 151.584ms

    D/NetworkSecurityConfig: No Network Security Config specified, using platform default

    I/OpenGLRenderer: Davey! duration=927ms; Flags=1, IntendedVsync=227516551969, Vsync=227749885293, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=227754476700, AnimationStart=227754570400, PerformTraversalsStart=227754658600, DrawStart=227840918500, SyncQueued=227864832500, SyncStart=227945666200, IssueDrawCommandsStart=227946361100, SwapBuffers=228487604700, FrameCompleted=228525177900, DequeueBufferDuration=75000, QueueBufferDuration=465000,

    D/EGL_emulation: eglMakeCurrent: 0xebbb3620: ver 3 0 (tinfo 0xf2d98ce0)

    I/Choreographer: Skipped 49 frames! The application may be doing too much work on its main thread.

    I/OpenGLRenderer: Davey! duration=1082ms; Flags=1, IntendedVsync=227516551969, Vsync=227749885293, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=227754476700, AnimationStart=227754570400, PerformTraversalsStart=227754658600, DrawStart=228528476500, SyncQueued=228528928000, SyncStart=228532298600, IssueDrawCommandsStart=228532793300, SwapBuffers=228535395300, FrameCompleted=228602362700, DequeueBufferDuration=106000, QueueBufferDuration=1808000,

    D/EGL_emulation: eglMakeCurrent: 0xebbb3620: ver 3 0 (tinfo 0xf2d98ce0)

    I/OpenGLRenderer: Davey! duration=886ms; Flags=0, IntendedVsync=227763968672, Vsync=228580635306, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=228595608800, AnimationStart=228595693100, PerformTraversalsStart=228595802400, DrawStart=228595946500, SyncQueued=228596143900, SyncStart=228606284500, IssueDrawCommandsStart=228606595200, SwapBuffers=228612320900, FrameCompleted=228660186000, DequeueBufferDuration=73000, QueueBufferDuration=421000,

    W/.videostreamin: Verification of java.lang.String com.android.org.conscrypt.ExternalSession.getPeerHost() took 198.844ms

    W/.videostreamin: Verification of void com.android.org.conscrypt.ActiveSession.removeValue(java.lang.String) took 116.997ms

    W/.videostreamin: Verification of int com.android.org.conscrypt.TrustManagerImpl$TrustAnchorComparator.compare(java.lang.Object, java.lang.Object) took 446.700ms

    W/.videostreamin: Verification of void com.android.org.conscrypt.CertBlacklistImpl.<init>(java.util.Set, java.util.Set) took 672.073ms

    E/MediaPlayerNative: error (1, -1004)

    E/MediaPlayer: Error (1,-1004)

    D/VideoView: Error: 1,-1004

    D/EGL_emulation: eglMakeCurrent: 0xebbb3620: ver 3 0 (tinfo 0xf2d98ce0)

    D/EGL_emulation: eglMakeCurrent: 0xebbb3620: ver 3 0 (tinfo 0xf2d98ce0)

    D/EGL_emulation: eglMakeCurrent: 0xebbb3620: ver 3 0 (tinfo 0xf2d98ce0)

    D/EGL_emulation: eglMakeCurrent: 0xebbb3620: ver 3 0 (tinfo 0xf2d98ce0)

    D/EGL_emulation: eglMakeCurrent: 0xebbb3620: ver 3 0 (tinfo 0xf2d98ce0)

    I/chatty: uid=10135(com.example.videostreaming) RenderThread identical 7 lines

    D/EGL_emulation: eglMakeCurrent: 0xebbb3620: ver 3 0 (tinfo 0xf2d98ce0)

    D/EGL_emulation: eglMakeCurrent: 0xebbb3620: ver 3 0 (tinfo 0xf2d98ce0)

    And the emulator says "Can't lay this video"

    any ideas here?

  • divyank sharma

    Hey @EDMT Dev,
    I have a video file with multiple audio tracks inside it(In 3 different languages). I want to be able to change these audio tracks while playing the video in android studio.
    I have searched alot about this but found nothing.
    Commenting here with a hope that u can only help me reach out of this problem.
    PLEASE HELP ME BROTHER.

  • PETER UKEME

    Pls sir come up with tutorial on how to build Text-based adverts – short text messages with the option of clickable links.Polling platform – conduct surveys to thousands of users and receive results within hours.

  • Waqar Vicky

    Hi, Your videos tutorials are awesome i learnt a lot of new thing from your tutorials.
    Can you please make a tutorial on how to make a live video and audio call app by using "Wowza media engine"?

  • Yasmim Vieira

    Hi! Help me, when I emulate on the mobile the video does not turn, it is a black screen. Maybe I got wrong on the "VIDEO_PATH" part, I do not quite understand, thank you if you explain.

  • Abhishek A N

    Hi Sir….. I am getting a problem saying can't play this video when I used a YouTube video. So I changed the link to the link which you had used in your tutorial but still I am getting same problem. So can you help me with this ….. Am I doing something wrong??

Leave a Reply

Your email address will not be published. Required fields are marked *