anacona16/sonata-media-webcam-provider-bundle 问题修复 & 功能扩展

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

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

anacona16/sonata-media-webcam-provider-bundle

Composer 安装命令:

composer require anacona16/sonata-media-webcam-provider-bundle

包简介

Enable webcam provider for Sonata Media Bundle

README 文档

README

SonataMediaWebcamProvider add a new provider to SonataMediaBundle, it lets you capture an image from your webcam.

Requirements

  • Symfony 3.4+ applications.
  • SonataMediaBundle.

Please install each bundle following their instructions.

How it works?

This bundle replaces the binaryContent field. Video HTML5 element uses canvas element to get an image using base64 encoding, then a temporary file is created, then the Sonata ImageProvider class uses and processes it.

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest version of this bundle:

$ composer require anacona16/sonata-media-webcam-provider-bundle

This command requires you to have Composer installed globally, as explained in the Composer documentation.

Step 2: Enable the Bundle

If you are using Symfony Flex the bundle will be enabled automatically, if not enable the bundle by adding the following line in the app/AppKernel.php file of your Symfony application:

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Anacona16\Bundle\SonataMediaWebcamProviderBundle\SonataMediaWebcamProviderBundle(),
        );
    }

    // ...
}

Step 3: Prepare the Web Assets of the Bundle

Execute the following command to make assets available in your Symfony application:

php app/console assets:install --symlink

Step 4: Add assets to your layout

You need add the assets in your layout e.g. SonataAdminBundle::standard_layout.html.twig

JS

<script src="{{ asset('bundles/sonatamediawebcamprovider/sonata-media-webcam-provider.min.js') }}" type="text/javascript"></script>

That's it! Now everything is ready to use the Webcam provider.

Using SonataMediaWebcamProviderBundle

After you configure the SonataMediaBundle correctly you must add this lines to your SonataMediaBundle configuration file:

sonata_media:
    contexts:
        default:
            providers:
                # ...
                - sonata.media.provider.webcam

That's all, now you can capture an image from your webcam using SonataMediaBundle.

License

This bundle is published under the MIT License

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固