Detecting Mobile Devices That Can't Stream MP3 - MVC - asp.net-mvc

I am developing an MVC mobile web where I return an audio file depending on the URL parameters.
I want to add a condition where I return mp3 files for smartphones,
and return dm files for old mobile devices that cannot stream mp3 files
Is there a standard procedure that detects old devices or should I loop through all my options?

Check below two links if they are useful
http://www.dotnetglobe.com/2013/04/device-detection-in-aspnet-mvc-4.html
http://techbrij.com/display-mode-mobile-tablet-tv-aspnet-mvc
Update:
get device
$.browser.device = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));

Since there is an undefined list of devices that don't play mp3,
The safest way to do this is to state the devices that do play mp3,
and I'll leave the rest to the Else Clause.
If userAgent.Contains("iphone;") Or
userAgent.Contains("ipad;") Or
userAgent.Contains("symbianos;") Or
userAgent.Contains("ipod;") Or
userAgent.Contains("android;") Or
userAgent.Contains("blackberry;") Or
userAgent.Contains("samsung;") Or
userAgent.Contains("nokia;") Or
userAgent.Contains("sonyericsson;") Or
userAgent.Contains("symbian;") Then
Device = Modes.SmartPhone
Else
Device = Modes.OtherPhone
End If

Related

How to prevent recording of iOS screen using quicktime

So with iOS 8, we can now record the screen of iOS devices. I've searched extensively and cannot find a way to detect, let alone prevent, this recording. The app I'm working on deals with some potentially sensitive information and images and would like to prevent this if at all possible.
Thank you in advance for your responses and insights!
Anthony
Apparently, there is some way to detect whether a display or QuickTime streaming is connected, because the Netflix app will show an error when that is the case (which also means you can't just use an iOS device and stream to your computer to watch it in big). The app works perfectly if QuickTime streaming is off with the cable is plugged in.
Maybe it just detects whether an external display is connected, and screen recording behaves like that, so basically you might have some success with these APIs and notifications.
Also, you could use an encrypted HTTP Live Stream according to Apple which would be blacked out in the stream / the recording.

Record audio only in browser on iPads

I am working with a school group that has a Django website with a page that allows the users to press a button, record audio, and save this audio to their user pages. This website was built to work on computers and Samsung tablets with Dolphin browsers using the HTML Media Capture to capture the audio by launching the microphone app on the tablets. The group wants to now switch to iPads. I have been researching ways to launch the microphone app from iPads but it seems this is not possible using HTML5. I have done some research and seen the links below, but I don't know what the best strategy is to modify the existing website to make it work on the iPad.
What is the best way forward to allow this group to record audio (not video) from their iPads using a browser-based website?
Research--
http://caniuse.com/#search=getUser - shows getUserMedia will not work on iPads
http://www.html5audio.org/2012/11/capturing-audio-on-ios-6-via-the-videotag.html - looks pretty hacky, does it work?
How to record and play voice in ios6 using HTML5 - using PhoneGap might work, but how would the recording app be launched from the browser and then save back the audio to the users account?
Thanks,
Lee
After having the same problem for a year, I found a new article with a solution: How to record audio from a mobile web page on iOS and Android
One of the newer APIs available is the MediaRecorder API. My first attempt at building this application started with this class. I implemented the entire application and it worked great on my desktop. It was easy to capture audio and the data was already compressed into .ogg format and ready to ship to my server. Then I tried it on iOS. It turns out that the MediaRecorder API is not supported and wouldn’t meet my needs. After I stopped cursing Apple, I began again from scratch.
... That was the last piece of the puzzle that allowed me to construct a working demo and it revolves around three steps:
1. Capture the microphone so we can begin recording
2. Accumulate captured audio data into a series of byte array chunks
3. Combine the chunks into one large array and massage the array into the format of a .wav file
There is a bunch of code on the website. And here is the demo file: https://www.gmass.co/blog/wp-content/uploads/2018/03/wzrecorder.zip
I have tested it and it works on iPad.
Demo: https://q2apro.github.io/wzrecorder/
Safari iOS does not (yet) support the accept="audio/*" part of the <input> element even though it does support taking videos and images through HTML Media Capture.
<input type="file" accept="audio/*" > on iOS 10 will prompt the user to select between:
Take Photo or Video
Photo Library
iCloud Drive
More...
The same code works just fine in Chrome on Android.
Safari in iOS6 was the 1st mobile Safari to support the <input ... > element and I've tested all the way up to iOS10. Chrome on iOS uses the same rendering engine so the same limits apply.

Mobile-friendly audio player for Rails app?

I'm currently building a Rails app, where a user can upload an mp3 and listen to it. I'm using paperclip for the data upload, but I'm not sure how I'd arrange the playback of the soundfile, so that it can be used on a mobile phone as well (so no flash).
Thoughts?
The two main cross-browser media playback frameworks are jPlayer and SoundManager.
Both will handle playback of your audio, regardless of device. Both will play the audio using either HTML5 or Flash according to
which solution is available
which solution you specified as higher priority (e.g. use HTML if available, Flash if not)
I'm using JW Player and I'm very happy about it. There is a HTML 5 mode that runs on newer mobile devices like the iPhone.

Play audio file on BlackBerry Storm

I want to play an mp4 audio file from a URL. This code works for a non-touch device, but I am facing a problem playing on the Storm.
Player player = javax.microedition.media.Manager.createPlayer(url);//_source
System.out.println("******************LoginScreen.player" + LoginScreen.player);
playerListener = new MediaPlayerListener();
LoginScreen.player.addPlayerListener(playerListener);
LoginScreen.player.realize();
LoginScreen.player.prefetch();
LoginScreen.player.start();
As you are using a HTTP location, you should specify an interface.
For wifi: ;interface=wifi
Thus your url should be like so:
String url= "http://yoursite.com/file.m4a;deviceside=true;interface=wifi";
Player player = javax.microedition.media.Manager.createPlayer(url);//_source
Check if your file is created with the supported codecs for Blackberry Storm
http://docs.blackberry.com/en/smartphone_users/deliverables/18349/711-01774-123_Supported_Media_Types_on_BlackBerry_Smartphones.pdf
that will be the reason why you can´t reproduce your audio file
for a MP4 Audio files playing in BlackBerry Storm smartphones the
supported codecs are: AAC-LC, AAC+, eAAC+
AMR-NB QCELP EVRC
for my experience sometimes you can reproduce files created with other codecs but you will find some problems on playin... =(
hope it helps

Simultaneously playing and recording video on blackberry smartphone

I intend to record and play video at the same time on my application. I am using BlackBerry JDE 5.0 and the Blackberry 9550 .
I initialize two players, one to play media, and another one to record media. I used Manager.createPlayer(rtsp://server ip: port) to play video.
String myEncoding = "encoding=video/3gpp&width=360&height=480&fps=6&vi​?deo_rate=16000&rate=8000";
mRecordPlayer = javax.microedition.media.Manager.createPlayer("cap​ture://video?" + myEncoding);
mRecordPlayer.realize();
_recordControl = (RecordControl)mRecordPlayer.getControl("RecordCon​trol");
mRecordPlayer.start();
I have recorded to a file . but the file always is 0 kB. I do not believe this way :createPlayer("capture://video?" + myEncoding) can record video from other player. It just records video from camera.
Is it possible to achieve the desired functionality with the API's exposed by RIM.
I would really appreciate if anyone could provide some pointer or help to solve the above mentioned problems.

Resources