Hi,
the IP must be accessible to the device. Android and iOS block HTTP URLs by
default (only https is allowed) so try this:
https://stackoverflow.com/questions/57121953/usescleartexttraffic-not-permitted/57130188
On Monday, September 14, 2020 at 5:50:59 PM UTC+3 [email protected] wrote:
> Hi,
> 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+)?
> The code :
>
> protected void postTestForm(Form f) {
> 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");
> }
> }
> Kind regards,
>
> IDE: NetBeans 12
> Desktop OS
> Simulator
> Device
>
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/877596a2-14ff-4811-a09b-73d6b884e865n%40googlegroups.com.