public class radyakanali1 extends Activity {
private String path = "http://radyoip...";
private VideoView mVideoViev;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
if (!LibsChecker.checkVitamioLibs(this))
return;
setContentView(R.layout.videoview);
mVideoView = (VideoView) findViewById(R.id.surface_view);
if (path == "") {
// Tell the user to provide a media file URL/path.
Toast.makeText(radyokanali1.this, "Kanal eklenmemiş." + " Lütfen bir kanal ekleyin.", Toast.LENGTH_LONG).show();
return;
} else {
mVideoView.setVideoPath(path);
mVideoView.setMediaController(new MediaController(this));
mVideoView.setOnErrorListener(mOnErrorListener);
mVideoView.requestFocus();
mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mediaPlayer) {
// optional need Vitamio 4.0
mediaPlayer.setPlaybackSpeed(1.0f);
}} ); }}
private OnErrorListener mOnErrorListener = new OnErrorListener() {
@Override
public boolean onError(io.vov.vitamio.MediaPlayer arg0, int arg1,
int arg2) {
Toast.makeText(getApplicationContext(), "Bu kanal şu anda hizmet verememektedir. Lütfen daha sonra tekrar deneyin...", Toast.LENGTH_LONG).show();
Intent intent = new Intent(radyokanali1.this, anasayfa.class);
startActivity(intent);
return false;
};};};