Android 4.0+ RemoteControlClient MetadataEditor Bluetooth - android

When I bought my new car I noticed that it had a screen that showed metadata information about the music playing through the Bluetooth audio sink. It worked for some apps, but notably not with the app I primary use for listening to music. After some research, and reading posts from this site and some others I was able to determine that this works if the app implements the ICS lockscreen controls with RemoteControlClient and MetadataEditor.
Since the app I use is open source I was able to download the source code and see that the app did not use the RemoteControlClient. my next step was to look at the Google Sample code for Random Music Player and test this on my phone and car. This worked successfully and I proceeded to modify the existing source code for the app I am working on. I copied the RemoteControlClientCompat and RemoteControlHelper Classes into my project and copied the code using these classes into my project's code as best as possible.
Since doing this I have successfully implemented Audio Focus management, Media Button Controls, and the RemoteControlClient / MetadataEditor. The lock screen controls are working and functioning perfectly, however my car still does NOT show the Metadata. Again the BT metadata works with the sample code, but not with my app, and the lock screen controls work without issue on both apps.
Anyone out there have any idea as to why the lock screen controls would work, but the Bluetooth Metadata would not?
Thanks,
Ryan

Related

Flutter (Screen recorder) Securing Music stream App, IOS & Android

Is there a flutter solution to securing music app from screen recorder (Even the app runs in the background), like apple music app did, stop the music when you start screen recorder. We have tried windowmanager package & secure application but no one works in IOS.
We have a mobile app to stream music, the app implement in-app purchase, every song should be bought before listening, and the content is exclusive for the app. that's why we need to secure the app, we have searched a lot for flutter packages and native implementations but we haven’t find a solution for IOS specific .
You should implement this natively for iOS.
Use isCaptured property in UIScreen to know if screen recording is happening (you can do this for iOS 11+)
You can use Key-Value Observing to know when isCaptured changes
Apple says:
To prevent the system from recording the audio portion, observe the isCaptured property and take appropriate action in your app as described...
see the documentation
EDIT:
I've found this library flutter_forbidshot it is helpful, and I think it is suitable for this problem.

Xamarin Forms allow music from another app on Android while playing Video

I am facing the issue, that my App Blocks Background Music when using a MediaElement for Video usage.
The bottom line is that I want to play a silent video and the user should still be able to listen to spotify and etc. in the background
In iOS the procedure to allow Background Music is pretty straight forward. On Android I cannot manage to get it working.
I already tried different xamarin.forms libraries where i set the video to mute or the volume to zero.
But nothing seemed to work. I tried for example octane, mediamanager and several other videoplayers.
For this reason, I would now like to try to implement it in the native Android code.
But I haven't found anything about it in various forums.
Xamarin Forms Version is 4.8
You could use a service to stream audio to play audio while your application is not visible or under the lock screen.
You could check the blog about this and download the source file from the Github. https://devblogs.microsoft.com/xamarin/background-audio-streaming-with-xamarin-android/
I test with the sample in the thread i done before to play the audio. libVLCsharp.forms can not play Android resource video file while iOS can
When i make the app which play music in the background, the music would play as well.

Android how to keep my music playing even when the phone is lock and sleep

am new in mobile app development, but have try do develop online radio app using Android Studio, but when the app is playing the sound from Icecast it use to stop when the phone is lock and sleep.
Also i find it difficult to set the accurate width that can march any app, the one that i set only work for Small Android Screen. The code full the width of small android phone with android 4.0 but on large screen android phone i can see some space beside and at the bottom of the screen.
Main XML Code
You should use MediaSession since its designed to help you control Media playing and controlling media playback. Check the reference and follow steps for using MediaSession.
Universal Android Music Player
This sample shows how to implement an audio media app that works across multiple form factors and provide a consistent user experience on Android phones, tablets, Android Auto, Android Wear, Android TV and Google Cast devices.
It also work on lock screen.
link to sample app and source code
hope this will help you.

SoundCloud HTML5 Widget API - Play Not Working in Chrome for Android

You can see the player live here:
www.stateofpsychosis.com/media/
The viewable player is a custom player. The default SC player has been shrunk down to a 1x1px iframe so it can't be seen without using the developer tools to make changes to the style.
This is only a problem on Chrome for Android
For some reason I can't get the API to actually play the music. The Previous/Next buttons work in the sense that they query and change the info, but they won't play the song either. It does however change the default SoundCloud widget play button to a pause button. It changes the track info. But it just won't actually make any noise. If I make the widget viewable and push anything in the default player (as opposed to the custom one), it seems to work though.
I too, am facing the same issue.
It seems that Chrome for Android restricts the ability to trigger HTML5 audio playing. This is to protect users from extra data usage on their phones. It seems that triggering the audio to play from a script is not allowed.
You can read more about the issue
here
Hopefully they lift this restriction in the near future.

Play an HLS audio only stream on IOS and Android but keep audio controls

Here the short of it.
I'm using an HLS stream with JWPlayer6 for an iOS/Android app I am working on. JWPlayer http://www.longtailvideo.com/ works well and fallbacks to other streaming and player types gracefully. The problem is this, when I want to securely play back audio only in iOS the player is just a condensed black rectangle with a play icon in the middle if I click on the audio it plays fine but it launches the file in quicktime window, and the quicktime player window completely covers the app so you can't listen to the file and continue to use the app.
Is there any possible way to play an audio only stream that utilizes an actually embed-able player instead of the default mechanism of launching audio media types on iOS and Android.
I have already used JPlayer to achieve the functionality I want by placing the js/css player at the bottom of the app in a fixed position so that you can still browse the app while the file is being played, but this is only demo solution for my boss to show him how it would work, but in the end we will need a solution that can securely stream the audio with a player that lets you keep the controls in-app on the page rather than launching quicktime which even after playing the file does not return you to the apps other views.
Any suggestions would be greatly appreciated.
Lol...anyway finally figured out a solution that works for me in my particular case. Since the html side of things for our application resides in a webview on iOS, thanks to phonegap, I was able to do the following.
HTML5 inline video on iPhone vs iPad/Browser
and now the player finally plays inline just like the iPad. I tested this and it works flawlessly. I also tested it without added the obj-c flag in the app code and it does not work. This means the solution I've provided only works if you are packaging you application using html and obj-c like with phonegap or Titanium etc. This is EXACTLY what I was looking for. Now I can use all of jw's awesomeness and still play nice with iOS and give a great user experience to all of our members...thanks for you time and patience. As a side note the inline audio only player even works flawlessly with Android to write of of the box not java code needed to edit anything. Surprised me because I know how HLS is not really all that well supported yet on the Androids.

Categories

Resources