视频捕捉的电话峡+本地插件的限制 [英] Limitations of Video Capture in Phone Gap + Native Plugins

查看:207
本文介绍了视频捕捉的电话峡+本地插件的限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发针对iOS和Android平台的移动应用程序。该应用程序将包括:

I am developing a mobile app targeting the iOS and Android platforms. The app will consist of:

  1. 一个比较简单的类型的接口,并从现有的Web应用程序搭载一个已经建成的web服务的用户登录/数据库项目的注册和上市。

  1. A relatively simple 'user login/signup and listing of database items' type of interface, powered by an already built webservice from and existing web application.

一个视频采集和上传功能,使用本地插件。

A video capture and upload feature using native plugins.

我已经做了广泛的研究的PhoneGap的最后一个星期,并且已经确定,即使考虑到有据可查的问题和PhoneGap的局限性,它非常适合我的应用程序的第一部分。

I have done extensive research on PhoneGap for the last week, and have determined that even considering the well documented issues and limitations of PhoneGap, it is well suited for the 1st part of my app.

不过,考虑到PhoneGap的捕获API(org.apache.cordova.media捕获)的局限性,它不适合用于捕获视频的上传,这主要是由于缺乏对视频规格的控制。 (在大多数设备,视频捕获将是巨大的高清文件不适合上传,甚至无线上网,肯定不会超过3G / 4G。)

However, given the limitations of the PhoneGap Capture API ( org.apache.cordova.media-capture ), it is not appropriate for capturing video for upload, mostly due to the lack of control over video specs. (On most devices, video captures will be enormous HD files that are not suitable for upload, even on Wifi, and certainly not over 3g/4g.)

由于我的资源和时间安排,我已经确定,在Java和ObjC构建本机应用程序是不切实际的,至少目前如此。我很少ObjC和Java的经验,但我相当有信心,并渴望学习这些语言如果需要的话。

Given my resources and timeline, I've determined that building native apps in both Java and ObjC are impractical, at least for now. I have very little ObjC and Java experience, but I am fairly confident and eager to learn these languages if need be.

这是说,我正考虑2个选项:

That said, I am considering 2 options:

  1. 第一,也可能是最合理的,是我挑的我现有的用户群(IOS)的更大的市场份额的平台,吸起来,去当地人。

  1. The first, and probably most rational, is that I pick the platform with the greater market share of my existing user base (iOS), suck it up, and go native.

第二,也许崇高的选择,是我开发PhoneGap的混合应用程序,针对这两个平台,并通过建立对Java和ObjC本地插件使用的PhoneGap的插件API绕过我的视频拍摄能力的限制,从而减少了对应用程序的其他部分的开发时间,并且只用在需要的地方本土code。

The second, and perhaps lofty option, is that I develop a hybrid app in PhoneGap, targeting both platforms, and circumvent the limitations of my video capture ability by building native plugins for Java and ObjC using PhoneGap's plugin API, thus reducing development time on the rest of the app, and using native code only where it's needed.

我的视频采集插件的要求将如下:

The requirements of my video capture plugin would be as follows:

  1. 完全控制录制的视频,最重要的分辨率和比特率的规格。 (presumably与AVFoundation等中的Adroid SDK)的

  1. Have complete control over the specs of the recorded video, most importantly resolution and bitrate. (Presumably with AVFoundation, and the like in Adroid SDK).

控制的视频拍摄功能的用户界面。

Control the user interface of the video capture functionality.

当然,我知道,在原生API的发展而按市场现有的应用程序显而易见的,当这些任务很有可能在这两个平台。 (藤等)。

Obviously, I am aware that these tasks are very possible on both platforms when developing in the native api's as is evident by existing apps in the market. (Vine, etc..).

我的真正的问题,是有什么限制,并通过PhoneGap的的插件API扩展本机功能的问题?有在PhoneGap的完成与视频采集机实现这个层面的工作几乎没有任何实例。一个例子,我发现的是这个插件,<一个href="https://github.com/EddyVerbruggen/VideoCapturePlus-PhoneGap-Plugin/tree/1dabebe06cc5482a4574b800508a91230e25591b">VideoCapturePlus,这虽然我一直没能得到工作,似乎有希望的。

My real question, is what are the limitations, and issues with extending native functionality via PhoneGap's Plugin API? There are almost no examples of work done in PhoneGap with this level of native implementation of video capture. The one example I've found is this plugin, VideoCapturePlus, which although I haven't been able to get to work, seems promising.

我特别感兴趣,看看是否有任何人成功实施本地插件在PhoneGap的复杂性的这个水平,或者如果它是一个兔子洞,我会希望我没有下降。

推荐答案

我已经基本上得到了对这个问题的底部,那我肯定其他人,将面对的问题。我会在3个部分的题目是:

I have essentially gotten to the bottom of this question, that I am sure others are and will face. I will address the topic in 3 parts:

我可以做的PhoneGap [东西]?

这是一个问题,我想像许多开发商考虑的PhoneGap框架发现自己问,因为没有一的简短的回答是肯定的,你也许可以。

This is a question I'd imagine many developers considering the PhoneGap framework find themselves asking, as did I. The short answer is YES, YOU PROBABLY CAN.

我如何做的PhoneGap [东西]?

插件这里的难题:!科尔多瓦(PhoneGap的),在所有它的辉煌是极其有限的它访问本机硬件功能的方式,尤其是当你进入视频/照片/音频采集

Plugins! Here's the rub: Cordova (PhoneGap) in all it's brilliance is extremely limited in the way it accesses native hardware features, especially when you get into video/photo/audio capture.

这是哪里的插件进来,有成千上万的PhoneGap的插件在这一点上。许多人简单,只要4行Java和Objective C中的得到了一些简单的事情,PhoneGap的也做不了。另一些大项目用自己的生命周期。

This is where plugins come in. There are thousands of PhoneGap plugins at this point. Many are as simple as 4 lines of Java and Objective C to get over some simple thing that PhoneGap just won't do. Others are large projects with lifecycles of their own.

在我的情况下,它变得很清晰很早就明白,我是不会要能够建立我与PhoneGap的存在的视频拍摄功能的应用程序。这就是说,我去逛街的插件。通过我的项目结束时,它已采取2插件,扩展的视频功能和四个更多的事情要做,我需要其他小各种各样的事情。在少数情况下,插件我发现没有我需要的一切,我清盘造成的code位。如果项目是活跃在GitHub上,我强烈推荐这个。

In my case, it became very clear very early on that I was not going to be able to build my app with the video capture functions that existed in PhoneGap. That said, I went shopping for plugins. By the end of my project it had taken 2 plugins that extended video functionality and four more to do other small various things I needed. In a few cases, the plugins I found did not have everything I needed, and I wound up contributing bits of code. If the projects are active on GitHub, I highly recommend this.

在最后,有些事情我想做的事,我无法找到插件。我仍然有计划地建设一些我自己的,但我还没有。底线:游戏和其他3D渲染的应用程序之外,你会pssed找到的东西,不能用PhoneGap的插件来实现硬$ P $

In the end, there were things I wanted to do that I could not find plugins for. I still have plans to build some of my own, but am not there yet. Bottom line: Outside of gaming and other 3d rendering applications, you'll be hard pressed to find something that can't be achieved with a PhoneGap plugin.

对于那些专门在视频采集感兴趣,这些都是2的插件,让我在我的项目中驼峰:

For those interested specifically in video capture, these are the 2 plugins that got me over the hump in my project:

<一个href="https://github.com/EddyVerbruggen/VideoCapturePlus-PhoneGap-Plugin/blob/ae613f3d2bc0b921e6f2d27e748b19d142e62403/README.md">VideoCapturePlus

<一个href="https://github.com/sebible/cordova-videosnapshot/blob/5103e5af395925ae2ce0c4c98b5be4a2af311dc4/README.md">Video截图

我应该建立自己的应用程序,并在PhoneGap的[东西]?

当然,这个问题要由每个开发人员,什么应用程序的目标是什么。就我而言,一个简单的应用程序,除其他事项外拍摄和上传照片和短片,是完全可能的。当然,还有的情况,即应用程序的参数和目标,使其使得本地发展是最好的选择。

Of course, this question is up to each developer, and what the goals of the app are. In my case, a simple app that among other things captures and uploads photos and short videos was quite possible. There are certainly cases in which the parameters and goals of the app make it such that native development is the best option.

也就是说,对于大多数个人开发者或者小团队与有限的资源和很少或没有Java或ObjC的经验,问题的答案,我应该考虑的PhoneGap?,将[我最好的吉姆Halpert声音] 当然,你应该。作为额外的奖励,我要说的是:就我而言,HTML5的布局,和许多前端JS被同时用于Android和iOS版本的我的应用程序中的大部分是可重复使用我的应用程序的移动网页版。能够保持一个codeBase的为这三样东西提供效率,即使是较大的资源匮乏的组织不应该忽视。

That said, for most solo devs or small teams with limited resources and little or no Java or ObjC experience, the answer to the question, "Should I consider PhoneGap?", would be [in my best Jim Halpert voice], "Absolutely you should". As an added bonus, I will say this: In my case, the HTML5 layouts, and much of the front end JS that were used for both the Android and iOS versions of my app are largely reusable for the mobile web version of my app. Being able to maintain a single codebase for those three things offers efficiency that even larger resourced organizations shouldn't overlook.

这篇关于视频捕捉的电话峡+本地插件的限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆