Thursday, 15 May 2014

videoview - How to play 3 videos from raw folder in same Activity on different Button clicks in Android? -



videoview - How to play 3 videos from raw folder in same Activity on different Button clicks in Android? -

i have play 3 videos on 3 different buttons in same activity.

my first video gets played , if play video lastly screenshot image comes in foreground , current video playing behind screenshot image of previous video.

please help me have asked question before , given http://blog.lemberg.co.uk/surface-view-playing-video solution not helpful me..

i have tried of playing video on different activity , after completion of video comes previous activity. not suitable me according current code structure..

you can utilize 1 video view in activity , switch content play while buttons clicking. before starting video playback,just check whether video playing or not videoview can check by

videoview.isplaying()

if playing stop , start new video content loaded raw. thought while clicking button, check videoview playing stop , start, else start.

create function this

playvideo(string path) { uri uri = uri.parse(uripath); mvideoview.setvideouri(uri); mvideoview.requestfocus(); if(mvideoview.isplaying()) { mvideoview.stopplayback(); } mvideoview.start(); }

call function in 3 button clicks 3 different paths.

android videoview mediacontroller surfaceholder textureview

No comments:

Post a Comment