johnson/yii2-webcam 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

johnson/yii2-webcam

最新稳定版本:v0.0.1

Composer 安装命令:

composer require johnson/yii2-webcam

包简介

Capture and upload the image through system / Mobile web cam basic html5 native features.

README 文档

README

Capture and upload the image through system / Mobile web cam basic html5 native features. The current release only captures the image from webcam and shows the image in a div. If the desktop does not has webcam obviously can't use this extension any more.. LOL.

Note:

In the localhost chrome browser may not work due to https restrictions. When it goes to production the web app must be in https to work at all platforms. You may test the functionality at FireFox browser.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist johnson/yii2-webcam "*"

or add

"johnson/yii2-webcam": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

<?= \Johnson\JayWebcam::widget(); ?>

If you pass the ID of the input element then the base64 encoded image data will be stored in the "value" attribute of the element after taking the snapshot.

If you want to show the thumbnail to the users then you can give the "imgID" property i.e the tag id attribute value. Then the widget will assign the base64 encoded image into the element.

For Example: PHP Code

<?= \Johnson\JayWebcam::widget(['id' => $YourID,'imgID' => $imgID]); ?>

HTML Code

<input type="hidden" id="<?= $YourID ?>">

<img src="" id="<? $imgID ?>" class="thumbnail">

After clicking the snapshot the value attribute will be assigned to the given element based on ID.

Example image output :

"data:image/png;base64,ASF9D8ASDF89ASDFHA8S9DFH98ADS...."

The following link may help to save the file to web server

https://gist.github.com/fazlurr/9802071

统计信息

  • 总下载量: 2.09k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 2
  • Forks: 7
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-07-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固