Code example for FileInputStream

Methods: close, getFD

0
				});   
 
		//  It appears that for security/permission reasons, it is better to pass a FileDescriptor rather than a direct path to the File.   
		//  Also I have seen errors such as "PVMFErrNotSupported" and "Prepare failed.: status=0x1" if a file path String is passed to   
		//  setDataSource().  So unless otherwise noted, we use a FileDescriptor here.   
		if (fis != null) fis.close();
		fis = new FileInputStream(mediaFile);  
		mPlayer.setDataSource(fis.getFD());
		mPlayer.prepare();  
		//  release mediaPlayer cause it will be covered 
		if (this.mediaPlayer != null){
			this.mediaPlayer.pause();
			this.mediaPlayer.release();
			this.mediaPlayer = null;
		} 
		return mPlayer;  
	}  
	public void pausePlayer(){   
		try {   
			getMediaPlayer().pause();  
		} catch (Exception e) {