Set video as Background for UI - Sketchware DreamPLAY Dev😎

 




ASD BLOCK CODES :

oncreate:
1.

RelativeLayout rl = new RelativeLayout(this); RelativeLayout.LayoutParams lparams = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT); rl.setLayoutParams(lparams); background.removeAllViews(); rl.addView(first); rl.addView(content); background.addView(rl);

2

vidview = new VideoView(this);
vidview.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
linear1.addView(vidview);

onpostcreate:
1

vidview.setVideoURI(Uri.parse(str));
vidview.start();

2

vidview.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { @Override public void onCompletion(MediaPlayer mp) { vidview.start(); } });

extra block

}
VideoView vidview;
MediaController mediaControls;
{