Codename one media player pause and play issue - codenameone

I am facing an issue with playing video files in Cn1.
The video starts playing on play, pauses on pause, but does not resume back on play.
This also happens with the kitchen sink app.
Device: Motox
Further, if I am using the native player mode, the video play and pause works fine, but the video does not launch properly in full screen. It gets aligned to the left of the screen and the application is seen in the background in the rest of the screen.
The application is in landscape mode.

This is a regression in Codename One's Android media player. It should be fixed for the next server update.

Related

How to play audio in iOS in background?

My goal is to make iOS play audio in a background.
When the audio is received by iPhone, it's not played unless I open the app in the foreground.
Basically, the iPhone is "waiting" when I click to open the app, and then it plays the audio.
Following Developer Guide, I added ios.background_modes=music to my .properties file.
However, nothing changed in behaviour.
I receive audio in real time via websocket class (onMessage(byte[] message) method).
What approach would you suggest in order to resolve this issue and make iOS play audio in a background?
This is the syntax for adding via the GUI not editing the properties file directly. You need to add the property with a codename1.arg. prefix.
Specifically: codename1.arg.ios.background_modes=music

Is there any way to stream music in the background with Ionic framework?

I'm developing an Android app using Ionic for music streaming, like a personal Spotify. I can easily play an audio file using Streaming Media plugin, but it seems that this plugin was made for video purposes, because it always brings the player to the front in fullscreen, so you can't navigate through the app while the music is playing, you also can't lock your screen or the playback is stopped.
Is there any way to stream music in the background? Like when I tap the song I want to play, it just starts playing without bringing in another screen? (like you can easily do in AndroidStudio with MediaPlayer). I've search it anywhere for the past week and I just can't find any solution.
I realized Background-Audio in my ionic2/3 Project with
cordova-plugin-media 3.0.1 "Media"
cordova-plugin-music-controls 2.1.4 "MusicControls"
and to workaround some issues on ios I need to add this plugin also
nl.kingsquare.cordova.background-audio 1.0.1 "background-audio"

MPVolumeView not showing audio routes on iOS 11

My app displays MPVolumeView button. When no earphone or bluetooth headset is not connected, clicking on this button shows two options. iPhone and iPhone speaker (for speaker and ear piece). This was perfectly fine till iOS 10. But on iOS 11, this button is disabled. It shows available routes only when connected to wireless headset.
I do not see any change or deprecated APIs in MPVolumeView. Anyone else seeing this issue?
Also a thing to note here is I still see old volume control indicator while I read about volume control indicator designed differently on iOS 11.
Figured out that I need to use AVRoutePickerView on iOS 11. This offers audio route options and also volume slider.

Youtube video keeps playing until app is closed

Some questions for playing youtube videos in webBrowser component.
I played youtube video in webBrowser component. But it keeps playing when the form is backed as well. It only stops playing when the app is removed. I tried webBrowser.stop() and webBrowser.destroy() method etc in the back command but with no success.
String getVideoUrl = "https://www.youtube.com/embed/" + videoId + "?autoplay=1";
WebBrowser player = new WebBrowser();
player.setURL(getVideoUrl);
f.addComponent(BorderLayout.CENTER, player);
However webBrowser.reload() solves the problem on android phones but not on Android Tablets.
While viewing the video, if the mobile is set to sleep by the user, the display goes out while watching the video. So how to disable the sleep mode?
Mobile screen display out problem.
When the video completes, the youtube video gives video link of the related videos & they can be played too, how can I disable that. I don't want to make other videos play from the app
The video doesn't play in android icecream sandwich and below.
Try: webBrowser.setPage("<html><head></head><body></body></html>", null);
You can use Display.getInstance().setScreenSaverEnabled(false);.
That's a setting on youtube for embedded links. You can select to disallow it.
That's a limitation of the html embed code from google. Not much we can do here.

Trying to create demo GIFs - How to get screen shots?

I am trying to create GIF animations for demoing my app.
In order to create animated GIFs of my app I need to get screen shots.
I do know that I can just call the Form.paint(Graphics)-method. However this will not correctly give me a screen shot whilst in drag-and-drop.
What is the best way of getting screen shots in Codename One?
I like doing this on the device so I use device video capture e.g. this for iOS & the new adb command for Android.
I sometimes use screen recording for desktop but not as often. You can then use one of the many mp4 to gif tools to convert the video to a GIF and also scale/remove frames/quality. I personally liked http://ezgif.com/

Resources