I use the code below to play a video from URL. It work on the simulator but does not work on android device (xperia z3+)?
try {
Media media;
media = MediaManager.createMedia("
http://178.128.204.162:3000/images/Lcode.maSpotMoutadaribine.mp4", true);
if (media.isNativePlayerMode()) {
media.setNativePlayerMode(true);
}
findCntVideoF().addComponent(media.getVideoComponent());
media.play();
Timer t = new Timer();
TimerTask ta = new TimerTask() {
public void run() {
media.pause();
}
};
t.schedule(ta, 6000);
} catch (Exception ex) {
Dialog.show("Video Error", ex.getMessage(), "Ok", "Cancel");
}