Code example for VideoView

Methods: setOnCompletionListenersetVideoURI

0
        } 
    } 
    public VideoView createVideoView(String resourcePath) {
        if(video==null){
            Log.i(TAG, "Creating video view");
            video = new VideoView(GameActivity.getContext());
            video.setOnCompletionListener(this);
            Log.i(TAG, "Setting...");
			try{ 
				GameActivity.pushView(video);
			}catch(Exception e){
				Log.e(TAG,"Ruh roh");
			} 
            Log.i(TAG, "Video view set as current");
        }else{ 
            video.stopPlayback();
        } 
        Log.i(TAG, "Setting video uri");
        video.setVideoURI(Utils.buildResourceUri(GameActivity.getContext(), GameActivity.getResourceID(resourcePath)));
        return video;
    } 
 
    @Override 
    public void onCompletion(MediaPlayer mp) {