VideoView setVideoURI - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for VideoView setVideoURI method.

This code example shows how to use the following methods:setVideoURI, start
        return mCustomView;
    } 
 
    @Override 
    public void navigate(String url) {
        mVideoView.setVideoURI(Uri.parse(url));
        mVideoView.start();
    } 
 
    @Override 
    public void stop() { 
        mVideoView.stopPlayback();
    } 
 
    @Override 
    public void destroyView() { 
        mVideoView.stopPlayback();
        mCustomViewCallback.onCustomViewHidden();
    } 
 
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:requestFocus, setOnCompletionListener, setOnPreparedListener, setVideoURI
		sMovie = this;
		 
		RelativeLayout layout = new RelativeLayout ( this );
		layout.setGravity ( Gravity.CENTER );
		 
		mVideoView = new VideoView ( this );
		mVideoView.setOnPreparedListener ( this );
        mVideoView.setOnCompletionListener ( this );
 
		layout.addView ( mVideoView, new RelativeLayout.LayoutParams ( LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT ));
		setContentView ( layout );		
		 
		String url = this.getIntent ().getStringExtra ( "url" );
		 
		MoaiLog.i ( "MoaiMoviePlayer onCreate: Initializing video player with media URL " + url );
 
		mVideoView.setVideoURI ( Uri.parse ( url ));
		mVideoView.requestFocus ();
	}	 
 

9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:requestFocus, setMediaController, setVideoURI, start
    } 
    public void videoPlayer(String path, String fileName, boolean autoplay){
        //get current window information, and set format, set it up differently, if you need some special effects 
        getWindow().setFormat(PixelFormat.JPEG);
        //MediaController is the UI control howering above the video. 
        videoView1.setMediaController(new MediaController(this));
        //accessing a video file to the video holder 
        videoView1.setVideoURI(Uri.parse(path+"/"+fileName));
        //get focus, before playing the video. 
        videoView1.requestFocus();
       // autoplay on activity call 
        if(autoplay){
            videoView1.start();
        } 
}} 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:requestFocus, setMediaController, setVideoURI, start
    } 
    public void videoPlayer(String path, String fileName, boolean autoplay){
        //get current window information, and set format, set it up differently, if you need some special effects 
        getWindow().setFormat(PixelFormat.JPEG);
        //MediaController is the UI control howering above the video. 
        videoView1.setMediaController(new MediaController(this));
        //accessing a video file to the video holder 
        videoView1.setVideoURI(Uri.parse(path+"/"+fileName));
        //get focus, before playing the video. 
        videoView1.requestFocus();
       // autoplay on activity call 
        if(autoplay){
            videoView1.start();
        } 
}} 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setVideoURI
 
    protected void onActivityResult(int requestCode,
                                    int resultCode, Intent data) {
        if (resultCode == RESULT_OK && requestCode == 1) {
            Uri uri = data.getData();
            mVideoView.setVideoURI(uri);
        } 
    } 
} 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setVideoURI, start
 
			@Override 
			public void run() { 
				pbar.setVisibility(View.GONE);
				if (video != null) {
					videoView.setVideoURI(Uri.parse(new File(video
							.getVideoFilePath()).toString()));
					videoView.start();
					imageViewThumb.setImageURI(Uri.parse(new File(video
							.getThumbnailPath()).toString()));
					imageViewThumbSmall.setImageURI(Uri.parse(new File(video
							.getThumbnailSmallPath()).toString()));
				} 
			} 
		}); 
	} 
 
	@Override 
	public void onError(final String reason) {
		runOnUiThread(new Runnable() {
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:requestFocus, setMediaController, setVideoURI, start
    } 
    public void videoPlayer(String path, String fileName, boolean autoplay){
        //get current window information, and set format, set it up differently, if you need some special effects 
        getWindow().setFormat(PixelFormat.JPEG);
        //MediaController is the UI control howering above the video to control the video 
        videoView1.setMediaController(new MediaController(this));
        //accessing a video file to the video holder 
        videoView1.setVideoURI(Uri.parse(path+"/"+fileName));
        //get focus, before playing the video. 
        videoView1.requestFocus();
        if(autoplay){
            videoView1.start();
        } 
}} 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setVideoURI
                                    int resultCode, Intent data) {
        if (resultCode == RESULT_OK) {
            Uri uri = data.getData();
            if (requestCode == 1) {
                // VideoViewに動画ファイルのUriをセット 
                mVideoView.setVideoURI(uri);
            } else if (requestCode == 2) {
                // プレイヤーを呼び出す 
                Intent intent = new Intent(Intent.ACTION_VIEW);
                intent.setData(uri);
                startActivity(intent);
            } 
        } 
    } 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:requestFocus, setMediaController, setOnPreparedListener, setVideoURI, start
	@AfterViews 
	void updateContents() { 
		setVideoOnBackground(); 
		 
		incomingInfoTextView.setText(incomingPhoneNumber);
		myVideoView.requestFocus();
		myVideoView.start();
	} 
	 
	@Background 
	void setVideoOnBackground() { 
		Uri defaultVideofile = Uri.parse("android.resource://" + this.getPackageName() + "/raw/a");
	    myVideoView.setVideoURI(defaultVideofile);
	     
	    myVideoView.setMediaController(new MediaController(this));
 
		myVideoView.setOnPreparedListener(new OnPreparedListener() {
		    @Override 
		    public void onPrepared(MediaPlayer mp) {
		    	mp.setLooping(true);

6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:requestFocus, setMediaController, setVideoURI, start
	 
	public void videoPlayers(String path, String fileName, boolean autoplay){
	    //get current window information, and set format, set it up differently, if you need some special effects 
	    getWindow().setFormat(PixelFormat.TRANSLUCENT);
	    //the VideoView will hold the video 
	    VideoView videoHolder = new VideoView(this);
	    //MediaController is the ui control howering above the video (just like in the default youtube player). 
	    videoHolder.setMediaController(new MediaController(this));
	    //assing a video file to the video holder 
	    videoHolder.setVideoURI(Uri.parse(path+"/"+fileName));
	    //get focus, before playing the video. 
	    videoHolder.requestFocus();
	    if(autoplay){
	        videoHolder.start();
	    } 
	} 
} 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related VideoView setVideoURI Questions & Answers: