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 best solutions below
Related Questions in ANDROID
- Delay in loading Html Page(WebView) from assets folder in real android device
- MPAndroidChart method setWordWrapEnabled() not found
- Designing a 'new post' android activity
- Android :EditText inside ListView always update first item in the listview
- Android: Transferring Data via ContentIntent
- Wrong xml being inflated android
- AsyncTask Class
- Unable to receive extras in Android Intent
- Website zoomed out on Android default browser
- Square FloatingActionButton with Android Design Library
- Google Maps API Re-size
- Push toolbar content below statusbar
- Android FragmentPagerAdapter Circular listview
- Layout not shifting up when keyboard is open
- auDIO_OUTPUT_FLAG_FAST denied by client can't connect to localhost
Related Questions in MEDIA-PLAYER
- mediaelement.js - How to change width
- Android several MediaPlayers
- How to use a MediaPlayer Singleton
- Playing audio for given amount of time in Android
- JavaFX MediaPlayer stops when file isn't complete
- Media Player: error (-19, 0)
- MP3 songs do not play in media player
- Send media action on android
- How do I allow my app to continue running when it is not in the foreground, or the phone is locked
- Set begin time of Azure Media Player
- Remote command seek forward (or backward) does not work
- Videoview measure to fit a layout with exactly ratio
- Unable to play MediaStore.Audio songs with MediaPlayer in android
- How to play songs from the Cursor in android?
- android media player is not playing audio file which has special character
Related Questions in RTSP
- Strange picture noise at the beginning of live stream
- ffmpeg stream rtsp to mpegts
- Only play rtsp video using VideoView or MediaPlayer after 3 minutes or more
- C# Vlc ActiveX Play rtsp stream
- Applying skin to VLC activex plugin to play RTSP source files in web pages
- WPF VLC PluginV2 Cache time delay
- Assertion error when encoding video using ffmpeg library on visual studio c++
- Failed to create element 'rtpbin'
- H.264 decoding error log from RTSP stream
- Check RTSP URI during onCreate in Android
- Live555 RTSPServer object destroyed improperly or the library bug?
- Recieving RTSP stream With JavaCV Library
- How to send data (input stream type - not video source ) to rtsp server
- How to make a mjpeg stream from pixelarray
- Why vxgplayer keeps loading in https?
Related Questions in ANDROID-VIDEOVIEW
- Android: Video Player Like Dailymotion App
- local videos on android not playing when device resolution is lower
- Only play rtsp video using VideoView or MediaPlayer after 3 minutes or more
- Android video player can't open file on some devices
- Android Full Width in Video View
- How can i place my videos on my own server and make URL of them using net-beans
- Playing a video on Android device
- Android VideoView resizing won't resize video
- Access videos both in internal storage and external SD card - Android
- display videoview defined inside a fragment in full screen
- android drawing rectangle on videoview and getting the co-ordinates
- How to resume video after a pause call in videoview android
- videoView seekTo not working after video edited using ffmpeg library - android
- Android VideoView looping with blending
- Android: NullPointerException when trying to load videoview through AsyncTask
Related Questions in SURFACEHOLDER
- Android - Surface is not valid
- Grafika TextureMovieEncoder
- IllegalStateException when returning to Activity containing MediaPlayer
- How can I play a video on a surface again after drawing black on it?
- java.lang.IllegalArgumentException:at android.view.Surface.unlockCanvasAndPost(Native Method)
- Android custom camera SurfaceView OnClick save image on sdcard?
- SurfaceView not working inside PopupWindow
- How to take screenshot from surfaceView in VLC
- Getting an android app to keep it's OpenGL Context after hitting the home button
- Sharing VideoView between two MediaPlayers not working
- Two SurfaceHolders in one Activity
- "The surface has been released" inside "surfaceCreated"
- Samsung Galaxy S4 Streaming Video Playback Orientation Issue
- How to Open Camera with surface holder in class which extends BroadcastReceiver
- .setPreviewDisplay(holder) throwing null pointer exception
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)
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?
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.