I'm creating a VideoView in runtime like this:
@Override
public View getUIElement(){
if(vv==null){
this.vv = new VideoView(this.getContext());
vv.setVideoURI(Uri.parse(this.url));
mc = new MediaController(this.getContext());
vv.setMediaController(mc);
}
return vv;
}
and after that I add this VideoView to LinearLayout I'm calling this:
public void initVideo(){
mc.show();
vv.setBackgroundColor(Color.TRANSPARENT);
vv.requestFocus();
vv.start();
Log.v("Video",vv.toString());
}
This code works perfectly on Froyo (2.2) and Gingerbread (2.3.5), but on ICS (4.0) and JB(4.1) nothing happens - VideoView is not even visible in parent View. Do you have any ideas why? In Uri.parse() I'm passing url to mp4 file.
--edit I forgot to tell, that in LogCat in ICS ang JB, MediaPlayer is not even called (in Froyo and Gingerbread there is some infos generated by MediaPlayer class).