Advertisement
Ahmed_Zouhir

Create video player [Sketchware /Code] by Ahmed Zouhir

Jan 1st, 2019
459
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. //add linear layout and name it to mylinear
  2. //create component and name it to video video/*
  3. //paste this code just like in the tutorial
  4. final VideoView vd = new VideoView(MainActivity.this);  
  5. vd.setLayoutParams(new RelativeLayout.LayoutParams(android.widget.RelativeLayout.LayoutParams.MATCH_PARENT, android.widget.RelativeLayout.LayoutParams.MATCH_PARENT)); mylinear.addView(vd);
  6. vd.setVideoURI(Uri.parse(path));
  7. vd.setMediaController(new MediaController(this));
  8. vd.requestFocus();
  9. vd.start();
  10. //note that i really work hard to provide this codes to
  11. //you so please support me by like πŸ‘ and subscribe πŸ“½οΈ
  12. //to my channel
  13. //my channel https://m.youtube.com/channel/UC85Bsb1LLPD977Zap2HSqpg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement