Now that Mobile Safari on iOS 6 supports capture and media library selection for photos and videos with the HTML5 input element is it possible to select videos with PhoneGap's camera.getPicture method?
<input type="file" accept="image/*, video/*" capture="camera" />
If not, a new camera.getMedia method which allows either media type would be great.
HTML5 file input for photos & videos on iOS6 Mobile Safari
HTML5 file input multimedia actions on iOS6 Mobile Safari
You can use navigator.camera.getPicture and set the MediaType to VIDEO in the options parameter.
Related
With one of the recent iOS releases, Apple seems to have changed the behavior of <input type="file"> when it comes to picking videos from the camera roll. It used to be that before the video file was handed over to the website, iOS would downscale the video to 720p and also convert it to H.264 (AVC).
Alas, this is no longer the case. Safari now forwards the video files "as is" and does not transcode them. In particular, it does not convert HEVC-encoded videos to H.264.
Is there a way to make <input type="file"> still transcode/downscale user-selected videos, ie., revert to the old behavior? I tried adding accept="video/*", but to no avail...
Answer to myself: turns out iOS does convert HEVC-encoded recordings to H.264 (and downscales them to 720p), but only if the multiple attribute is not set on the <input type="file"> element.
Once the multiple attribute is set, the HTML input element will receive the original HEVC-encoded videos and no compression/downscaling happens before they are handed to the website.
(Since I can't make a comment on your answer, I am writing my response here.) In August of 2022 my testing on iPhone 8 plus running Safari on iOS 15.4.1 shows that the "multiple" attribute does NOT control whether the video compression before uploading happens. It happens happens each time when selecting a single file or multiple files.
I want to build a HTML5 form, in which user can submit audio file from the desktop, and for mobile device, user have to record the audio directly. I use the following html5 code for the audio input
<input type="file" accept="audio/*" id="capture" capture="microphone">
It works properly, but not iOS device, and which always give me .mov video files instead of any audio.
Is it the limitation of iOS? And is there any workaround for my case?
Looks like it's just not supported through iOS and it's been that way for a few versions. Check out this link from another post.
I've below code in asp.net ascx file.
<asp:FileUpload ID="selectedFiles" runat="server" onchange="ShowImagePreview(this);" CssClass="inputhidden" AllowMultiple="true" ClientIDMode="Static" />
There is some javascript code in ShowImagePrivew which preview the image on the page. The problem is every time we capture the image in iPhone, i'm getting the same name of the file while in Android Phones it is different on each image capture.
1) In order to test open the link in iPhone and Android. http://aspuploader.com/demo/form-multiplefiles.asp
2) Click on Select Multiple files and select Take Photo
3) Take snapshot and upload that file
4) Again try to upload one more image
Result:
iPhone - It replace the old file. It uses image.jpg as temporary file name.
Android - It upload another file as well. It appends datetime as well.
Expected output: iPhone also should be able to upload multiple images.
Any Solutions?
After lot of search I believe that it is not possible as it is default iPhone Behavior.
Also Refer: Mobile Safari Multiple Upload with Camera
I build a simple web page that should enable our users to use the camera to upload documents copy.
It works great in android but in iOS mobile safari its only open the image library and doesn't let the user to simple open the camera and take a shot.
I've used that input field:
<input style="width:100%" class="upload" id="house" type="file" accept="image/*" capture doc="house" name="files[]" data-url="/api/upload/detail" multiple>
At the end the solution was simple.
The "multiple" attribute should not be present or it will go right to the gallery without giving the user the option to choose the camera.
Nir
In ios application, capturing video in mp4 format and uploading it to amazon server.
we are embedding this uploaded video url in html file using video tag.
The problem is, it wont play in firefox since is it doesn't support mp4 format .
in some forum and blogs I have seen that we need to provide multiple formats of video (mp4, ogg, webm etc) in html.
but uploading different file format videos to server is not a good solution.
Any solution for this to achieve, with once format from iOS device , and it need to support in at least chrome , firefox and safari browsers .
If Chrome PC/Mac, Firefox PC/Mac, and Safari Mac/iOS are what you support, then you needed to provide 2 video sources and 2 audio sources:
HTML 5 Video
src="video.mp4" type="video/mp4" codecs="avc1.4D401E, mp4a.40.2"
src="video.webm" type="video/webm" codecs="vp8.0, vorbis"
HTML 5 Audio
src="audio.m4a" type="audio/mp4" codecs="mp4a.40.5"
src="audio.ogg" type='audio/ogg; codecs="vorbis"
I agree, it's ridiculous, fortunately Mozilla has given up on boycotting patent encumbered media formats and has enabled Firefox (v35) Mac to play MP4s. I just recently discovered that AAC (MP4 audio) is compatible with Chrome, Firefox, and Safari. So now life is much more simpler:
HTML 5 Media Nirvana
src="video.mp4" type="video/mp4" codecs="avc1.4D401E, mp4a.40.2"
src="audio.m4a" type="audio/mp4" codecs="mp4a.40.2"
The only browser that's left out is Opera, I can live with that.