Reputation: 3229
I'm building an app for iOS which I'm currently developing using web programming languages. HTML, CSS, jQuery etc. I do that because it's quicker for me to work with these languages, in a first time.
My app will give users the possibility to record a video, and I know it is possible to do that since iOS 6 with HTML5 and to upload it to my server. However, I would like to be able to create a custom camera view, for example just like the one in Snapchat, with the ability to record a custom duration for the video (for example max 20 seconds), with a progress bar etc.
My first question is : from HTML5, is it possible to limit the duration of the record of a video ? For example with maximum 20 seconds ?
Second question : is it possible for me to continue to develop my app with web languages and when the user clicks on the "record a video button", an event is fired IN the iOS code directly ? So I can launch a custom camera view in iOS language and then send it directly to my server from the iOS code ?
Thanks for your help.
Upvotes: 0
Views: 1133
Reputation: 6092
First question: No, you can't create a custom camera view in HTML. This needs to be done in Swift or Objective-C on the device.
Second question:
I've read, that the new WKWebView
can recieve messages from a Javascript.
This tutorial explains, how your app can communicate with the Javascript via delegate-calls. It requires, that your content is NOT displayed in an UIWebView
, but in an WKWebView
(iOS 8 or newer required)
Upvotes: 1