简体   繁体   English

在移动Safari中录制音频

[英]Record audio in mobile Safari

I need to create an iOS app that just displays a website. 我需要创建一个仅显示网站的iOS应用。 The site allows users to record audio. 该站点允许用户录制音频。 The purpose is to let mobile Safari users to record audio (which is currently not supported). 目的是让移动Safari用户记录音频(当前不支持)。 Are there any decent solutions for this or am I going to have to hack my way through? 是否有任何合适的解决方案,还是我必须设法破解? So far I have the following two ideas: 到目前为止,我有以下两个想法:

1) Build a native application that contains a WKWebView of the site. 1)构建一个本地应用程序,其中包含站点的WKWebView。 If the website detects mobile Safari it will launch some JavaScript that the app can respond to (or it will try to bring the user to the App Store using Universal Links). 如果网站检测到移动Safari,它将启动该应用程序可以响应的一些JavaScript(或者它将尝试使用通用链接将用户带到App Store)。 The native app will then record the audio and send it back to the website somehow (either through an external server, or perhaps through JavaScript, not sure how much data can be passed, but it could be up to 1MB). 然后,本机应用程序将录制音频并将其以某种方式(通过外部服务器,或者通过JavaScript,不确定可以传递多少数据,但可能高达1MB)发送回网站。

2) Use an existing solution using perhaps Cordova/PhoneGap. 2)使用可能使用Cordova / PhoneGap的现有解决方案。

Hope to get some tips! 希望得到一些提示!

Build an hybrid application based on cordova/PhoneGap seems to be the best in my opinion. 在我看来,基于cordova / PhoneGap构建混合应用程序似乎是最好的。 In addition you can build for iOS and Android (if you need later). 此外,您可以针对iOSAndroid进行构建(如果以后需要)。

You can easily use this plugin to achieve your app. 您可以轻松使用此插件来实现您的应用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM