All Projects → video-dev → Can Autoplay

video-dev / Can Autoplay

Licence: mit
The auto-play feature detection in HTMLMediaElement (<audio> or <video>).

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Can Autoplay

Cctag
Detection of CCTag markers made up of concentric circles.
Stars: ✭ 172 (-12.24%)
Mutual labels:  detection
Vdetlib
Video detection library
Stars: ✭ 177 (-9.69%)
Mutual labels:  detection
Quantuminsert
Quantum Insert
Stars: ✭ 186 (-5.1%)
Mutual labels:  detection
Tf deformable net
Deformable convolution net on Tensorflow
Stars: ✭ 173 (-11.73%)
Mutual labels:  detection
Extd pytorch
Official EXTD Pytorch code
Stars: ✭ 177 (-9.69%)
Mutual labels:  detection
3d Bat
3D Bounding Box Annotation Tool (3D-BAT) Point cloud and Image Labeling
Stars: ✭ 179 (-8.67%)
Mutual labels:  detection
Ochumanapi
API for the dataset proposed in "Pose2Seg: Detection Free Human Instance Segmentation" @ CVPR2019.
Stars: ✭ 168 (-14.29%)
Mutual labels:  detection
Paddle2onnx
PaddlePaddle to ONNX model converter
Stars: ✭ 185 (-5.61%)
Mutual labels:  detection
Vip
Video Platform for Action Recognition and Object Detection in Pytorch
Stars: ✭ 175 (-10.71%)
Mutual labels:  detection
Online Privacy Test Resource List
Privacy Online Test and Resource Compendium (POTARC) 🕵🏻
Stars: ✭ 185 (-5.61%)
Mutual labels:  detection
Dockerface
Face detection using deep learning.
Stars: ✭ 173 (-11.73%)
Mutual labels:  detection
Vision3d
Research platform for 3D object detection in PyTorch.
Stars: ✭ 177 (-9.69%)
Mutual labels:  detection
Mcmot
Real time one-stage multi-class & multi-object tracking based on anchor-free detection and re-id
Stars: ✭ 181 (-7.65%)
Mutual labels:  detection
Object Detection
Object detection with ssd_mobilenet and tiny-yolo (Add: YOLOv3, tflite)
Stars: ✭ 173 (-11.73%)
Mutual labels:  detection
Fingerprintjs
Browser fingerprinting library with the highest accuracy and stability.
Stars: ✭ 15,481 (+7798.47%)
Mutual labels:  detection
Venator
[⛔️ Deprecated] Venator is a python tool used to gather data for proactive detection of malicious activity on macOS devices.
Stars: ✭ 172 (-12.24%)
Mutual labels:  detection
Awesome Video Anomaly Detection
Papers for Video Anomaly Detection, released codes collection, Performance Comparision.
Stars: ✭ 177 (-9.69%)
Mutual labels:  detection
Rpnplus
RPN+(Tensorflow) for people detection
Stars: ✭ 191 (-2.55%)
Mutual labels:  detection
Lidc nodule detection
lidc nodule detection with CNN and LSTM network
Stars: ✭ 187 (-4.59%)
Mutual labels:  detection
3d Pointcloud
Papers and Datasets about Point Cloud.
Stars: ✭ 179 (-8.67%)
Mutual labels:  detection

can-autoplay.js

The auto-play feature detection in HTMLMediaElement (<audio> or <video>).

FileSize Version

Demo page

Table of contents:

Installation

npm install can-autoplay

Files

Build files are available in the build/ directory. Bundlers will choose get the correct file chosen for them but if you just want to include it on the page, grab the build/can-autoplay.js file.

API

audio(options)

Parameters:

  • options.inline <Boolean>, check if auto-play is possible for an inline playback, default value is false
  • options.muted <Boolean>, check if auto-play is possible for a muted content
  • options.timeout <Number>, timeout for a check, default value is 250 ms

Returns:

  • <Promise>, resoles to a <Object>:
    • result <Boolean>, true - if auto-play is possible
    • error <Error>, internal or timeout Error object
canAutoplay.audio().then(({result}) => {
  if (result === true) {
    // Can auto-play
  } else {
    // Can not auto-play
  }
})

video(options)

Parameters:

  • options.inline <Boolean>, check if auto-play is possible for an inline playback, default value is false
  • options.muted <Boolean>, check if auto-play is possible for a muted content
  • options.timeout <Number>, timeout for a check, default value is 250 ms

Returns:

  • <Promise>, resoles to a <Object>:
    • result <Boolean>, true - if auto-play is possible
    • error <Error>, internal or timeout Error object
canAutoplay.video().then(({result}) => {
  if (result === true) {
    // Can autoplay
  } else {
    // Can not autoplay
  }
})

Example

import canAutoPlay from 'can-autoplay';

canAutoPlay
    .video({timeout: 100, muted: true})
    .then(({result, error}) => {
        if(result === false){
            console.warn('Error did occur: ', error)
        }
    })

Media

Implementation Details

If it's required to have a legacy browser support you could use latest v2.x.x version of the library.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].