2

Below is the code that I have used to play video in native video player. But I am not getting any default control like stop, pause, play.

What I am missing over here? If my code is wrong then what is the right code for that?

vc = VideoComponent.createVideoPeer("http://localhost/test.mp4"); 
vc.setFullScreen(true);
player = (Player) vc.getNativePeer();
player.realize();
addComponent(vc);
vc.start();
gnat
  • 6,213
  • 108
  • 53
  • 73
dhrut
  • 147
  • 1
  • 9

1 Answers1

0

Generally you are supposed to call vc.stop() etc. to perform the operations of the video control. I think there is a method getInternal() (or getNative I don't quite remember since we removed this class in Codename One) to gain access to the native control.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
  • but to call vc.stop() i have to add pause/stop button so that if user clicks on button then onactionlistener() i can call vc.stop(). – dhrut Apr 16 '12 at 04:14
  • 1
    That's missing on the old VideoControl. It works much better in Codename One. – Shai Almog Apr 19 '12 at 17:51