I have one main MediaPlayer which plays nicely an RTSP stream and I have used an AsyncTask to buffer the content of another stream. It achieves this. When I try to switch to the second stream, I can hear that the stream switched and it doesn't lag, but I only get sound. The SurfaceHolder holds a VideoView, it has been prepared, I registered it as Display for both mediaplayers. When I switch streams, I stop the old MediaPlayer but the surface doesn't get destroyed, which is good, but it doesn't display my second video. Any ideas?
Sharing VideoView between two MediaPlayers not working
1.2k views Asked by dulys At
1
There are 1 answers
Related Questions in ANDROID
- Creating global Class holder
- Flutter + Dart: Editing name of a tab shows up a black screen
- android-pdf-viewer Received status code 401 from server: Unauthorized
- Sdk 34 WRITE_EXTERNAL_STORAGE not working
- ussd reader in Recket Native module
- Incorrect display of LinearGradientBrush in IOS
- The Binary Version Of its metadata is 1.8.0, expected Version is 1.6.0 build error
- I can't make TextInput to auto expand properly in Android
- Creating multiple instances of a class with different initializing values in Flutter
- How to create a lottie animation
- making android analyze with coverity sast tool
- Flutter plugin development android src not opening after opening example
- I initialize my ViewModel in the Activity with several fragments as tabs, but the fragments(tabs) return null for the updated livedata
- Node.js Server + Socket.IO + Android Mobile Applicatoin XHR Polling Error...?
- How I can use the shared preferences class?
Related Questions in MEDIA-PLAYER
- Pyqt Display Video Thumbnail At Given Time Line
- Detect the voice of multiple person speaking
- My customized media player won't work with GeForce RTX
- What control should I use to play videos in .NET 6 app?
- Getting the duration of audio data in NextJS
- Playing an audio file stored on MongoDB Atlas
- How to update Kaltura player config when the playlist item is being switched?
- Error in Playing .mp4 video using Java Springboot
- How to play audio files synchronously (sequentially... one at a time... one after the other)? Kotlin/Android Studio
- Trying to sync the react players outside of home component using cleanup function but it is not working
- How to create and write to a virtual video device on Linux using C?
- How to load Media from Media server in React Native?
- Media player error Exception occurred during processing of request
- How can I hijack the twitter embedded post play back button in Android
- 'The system cannot find the file specified. ' when the count of the files is larger than 0
Related Questions in RTSP
- How can I integrate VLC in angular?
- How stream with gstreamer and open the stream on any computer
- Python + VLC + RTSP - cannot take screenshot
- python, vlc, rtsp. Screenshots doesn't work
- RTSP camera sub stream url
- Can we restrict client port range for GStreamer rtspsrc element?
- Android - RTSP Streaming from Camera and view from remote location
- Re-Identification while using YOLOv8 + ByteTrack on real time RTSP stream
- RTSP Stream Won't Start/Times out When Adding `rtspsrc` to Running Gstreamer Pipeline
- How to get frame number from FFMPEG RTSP stream
- Capturing rtspsrc headers in gstreamer
- Cannot open RTSP videostream with OpenCV in Java
- CCTV c# in WPF Forms exit button
- OpenCV real time streaming video capture is slow. How to get synced with real time?
- Encountering issues when attempting to stream RTMP with Jetson Nano using Gstreamer and OpenCV
Related Questions in ANDROID-VIDEOVIEW
- getting currentPosition on videoView
- Android VideoView ANR loading content from network
- Flutter PlatformView: Rendering PlatformView on Realme3
- How to set a VideoView thumbnail?
- Getting mediacontroller issue in videoview for landscape mode
- How to play animation(videoView) and mediaPlayer at the same time?
- VideoView in RecyclerView Adapter does not play
- I would like to use a Videoview and a Camera Preview at the same time
- Android Automotive OS Video
- Portrait Mode of video in android java
- Android Studio Videoview doesnt error : This vide cannot played
- jetback compose black background when using VideoView
- How can I get a rid of the little black box before the video plays with the Outstream renderer from Xandr?
- What view/template to use to play a video on Android Automotive?
- How to Change VideoView Requests from GET to POST method
Related Questions in SURFACEHOLDER
- Who is correct to use SurfaceView in background Thread?
- How to reuse SurfaceHolder on WallpaperService ,
- Attempt to invoke virtual method 'android.view.SurfaceHolder android.view.SurfaceView.getHolder()' on a null object reference
- Understanding of SurfaceView with and without SurfaceHolder.Callback
- android java.lang.RuntimeException:Fail to connect to camera service using SurfaceView
- Android Surfaceview SurfaceHolder Thread
- Camera not being released properly on Astro Tab A10 running Marshmallow
- lockCanvas failing when screen orientation changes
- How to play live streaming in RecyclerView using libVLC?
- SurfaceView Camera App Switch Camera and Fix Dark Preview
- holder.getSurface().isValid() is returning false
- Blank view when application is launched (SurfaceView)
- SurfaceView Example
- Nothing Shows Up on Canvas from SurfaceHolder . lockCanvas() [Android]
- Forcing layout to redraw
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Could you supply your VideoView instantiation code and the code you use to switch out the MediaPlayers?
In any case, I doubt this will work well because the VideoView instantiates its own MediaPlayer and uses it to play media. (see VideoView.java)
You would probably need to switch out the VideoView itself, or build a replacement for the VideoView using your own subclass of SurfaceView.