I have hosted a video file (uri=http://testserver/test.mp4) in the webserver and i want to load the file in the default media player in the through my metro style application. i have tried the
Windows.System.Launcher.LaunchURIAsyc(uri),
since the protocol used is http, the file loads in the IE.
i am looking for something analogous to MediaPlayerLauncher for Wp7
Related
I am trying to make a audio player for Ionic3.
First, I used tag in html. It works on IOS but not work in Android.
Second, I tried #ionic-native/media. But it should record first and can play.
I am wondering to how to implement audio player.
Please help.
You can easily use Ionic-audio plugin for that.
Here is the Demo
npm install ionic-audio --save
An audio player plugin for Ionic that works out of the box in the
browser and device using an underlying audio provider depending on the
environment. When running inside the browser the plugin will default
to a Web Audio provider, whereas on a device it will switch to Cordova
Media if cordova-plugin-media is available, otherwise falls back to
web audio.
Git Repo
I have some mp4 files which are served in a web app with the parameter to open them instead of downloading them :
"Content-Disposition inline
Here is my question :
Can I open my link/mp4 inside an external app such as VLC instead of chrome (for now it uses the default html5 player in a new tab)
I have looked for custom URI Schemes but I didn't understand a thing and I would prefer a solution working on Linux/Windows.
Thanks !
I've an audio file on my phone's SD card and I want to play it using my PhoneGap and HTML5 based hybrid mobile app. I am using the HTML5 audio tag as following:
<audio src="cdvfile://localhost/myfolder/subfolder/audio.mp3"><audio>
However unfortunately it doesn't play.
I want this to work on iOS, android and windows.
Please advice.
You should put the sound file in the www folder, or one of its subfolders.
I have successfully used audio tags in Cordova applications.
I have found two cases where audio will not play:
1) use of the new WKUIWebview plugin (does not allow the file protocol in thw www folder)
2) the head is missing a content security policy, which can happen creating an app with Phonegap instead of Cordova
I have a PhoneGap app which I wrote under PhoneGap 1.8.1 and it worked great under iOS 5.1.
I needed to change the app so downloaded the latest Xcode 4.5 and the iOS 6 SDK. But when I build the app and deploy it to my iPhone 4s, the HTML 5 audio will not play back when the phone is locked.
I tried upgrading the app to use PhoneGap 2.1.0 but when the phone is locked the app will still not play the audio. (Which is an mp3 file stream from my server.)
It all works fine in the simulator but does not work when on my iPhone 4s running iOS 6.
I have Required background modes set to App plays audio and Application does not run in background = Yes. Which used to work under iOS 5.1 but does not under iOS 6. I have also tried to modify the sound.mfile which some have recommended. Even though I did not need to do this under iOS 5.1
I have tried a bunch of examples I found on the internet but none seem to work in iOS 6. And allow HTML 5 audio to stream in with the phone locked.
What do I need to do to get HTML 5 audio to play when an iPhone is locked in iOS 6 under PhoneGap 1.8.1 or 2.1?
Doesn't Application does not run in background = Yes force the app to terminate instead of running in the background?
Isn't that the opposite of what you want? Perhaps try removing that key and just leaving the UIBackgroundModes set to audio?
EDIT:
It appears that since iOS 6 your application MUST set the AVAudioSessionCategory to AVAudioSessionCategoryPlayback to be able to play audio in the background. PhoneGap/Cordova does this for when you use the PhoneGap/Cordova Media API, but when using HTML5 audio it never gets set.
I tested using my ExampleHTML5AudioStreaming project and adding the UIBackgroundModes -> audio only but explicitly setting the AVAudioSessionCategory to AVAudioSessionCategoryPlayback in the AppDelegate.m file (under ProjectName/Classes).
I first imported AVFoundation in AppDelegate:
#import <AVFoundation/AVFoundation.h>
I then added the following to application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
BOOL ok;
NSError *setCategoryError = nil;
ok = [audioSession setCategory:AVAudioSessionCategoryPlayback
error:&setCategoryError];
As per this answer: https://stackoverflow.com/a/12414719/878602
Audio then played in the background as expected.
It looks like there is no bug lodged for Cordova for this. I will see if I can lodge one.
I am looking at building an app that can take a video from a person's media library on their mobile phone and upload it to my servers. As far as I can tell, I'd have to build an application for each type of mobile device I want to include. But if new HTML5 protocols let me upload video files through the browser (and can handle the file size), this would be a preferred method.
Web apps don't have access to the media library on a phone. Use phonegap to get access to the users photos - http://docs.phonegap.com/phonegap_media_capture_capture.md.html
Considering you are using iOS and running the WebApp in iOS' MobileSafari, you have NO access to any system related components, libraries or anything (so no Photos, Videos etc).
And Safari itself does not support file upload. You can add the tag but it will always remain as if had disabled="disabled" attribute.
The only way to access these components is by using a Native code or, like Joel said, PhoneGap since it gives the html pages, access to Native API's through it's JS Framework.
For Android, i have no idea but probably not.