Giter Site home page Giter Site logo

agoraio-solutions / agora-camera-release-js Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 181 KB

Sample app highlighting how to seamlessly release/acquire the camera when aiming to mute/unmute the device.

Home Page: https://www.agora.io

License: MIT License

CSS 95.76% HTML 4.24%

agora-camera-release-js's Introduction

agora-camera-release-js

This highlights how to release the camera when muting video in an Agora integrated web application.

Prerequisites

  • A web browser

Code Highlights

In index.html, pay particular attention to the streamCamera and muteCamera button click events, as well as the following Agora callbacks:

  • rtc.client.on("stream-subscribed", function (evt) {})
  • rtc.client.on("stream-updated", function (evt) {})
  • rtc.client.on("mute-video", function (evt) {})

Quick Start

This section shows you how to prepare, and run the sample application.

Obtain an App ID

To build and run the sample application, get an App ID:

  1. Create a developer account at agora.io. Once you finish the signup process, you will be redirected to the Dashboard.
  2. Navigate in the Dashboard tree on the left to Projects > Project List.
  3. Save the App ID from the Dashboard for later use.
  4. Generate a temp Access Token (valid for 24 hours) from dashboard page with given channel name, save for later use.

Integrate Agora Video SDK

Currently, version 2.9.0 of the Agora Web SDK is being used from Agora's hosted cdn. Alternatively, you may download the SDK, place it into assets directory, and rename file name as AgoraRTCSDK-2.9.0.js (make corresponding change in index.html).

Run Web-Server

  1. Install live-server globally via npm
    npm i live-server -g
    
  2. Launch server via following commands in working folder,
    live-server .
    
  3. Enter Valid APPID, Token, Channel, UID and click Join Room

Resources

License

The MIT License (MIT)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.