npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

recorderjs_webcam

v1.0.1

Published

JavaScript plugin to record or download the video of the web-cam.

Downloads

10

Readme

:movie_camera: RecorderJS (JavaScript plugin)

RecorderJs is a plugin developed in JavaScript. It allows you to instantiate a web-cam recorder from the browser. It offers you two possibilities. The one to download directly the recorded video and the one to get the link of the video and to make a move to the folder of your choice. Bootstrap resources have also been used for the layout of the different buttons, which you can also customize.

:information_source: To know !

The external resource used for button alignment is bootstrap and can also be modified or customized

:books: How to use ?

Once after importing the RecoderJs resource into your code with the <script src='...'> </script> tag or the import for those running on a nodejs server, you need to declare a JavaScript variable in JSON format that will be used to parameterize the plugin. This variable must respect this architecture.


var Json_RecordJs={

  'Start_Btn': {"class":"btn btn-success", "value":"Demarrer l'enregistrement"},
  'Stop_Btn': { "class":"btn btn-danger", "value":"Sauvegarder"},
  'Next_Btn': { "class":"btn btn-primary", "value":"Étape suivante"},
  'Message': 
  {
        "befor_html":" Démarrer l'enregistrement ",
        "in_html":"<p class='alert alert-danger'>En cours d'enregistrement</p>",
        "after_html":"<p class='alert alert-success'>Enregistrement ok</p>",
        "erreur_text":"Autorisé la webcam pour continuer"
  },

  'Download': true
}
  • The Start_Btn is the button to start the recording
  • the Stop_Btn is the button to stop the recording,
  • the Next_Btn, the one to submit the video once recorded.

Next_Btn button is optional

The Next_Btn button is only used in case you don't allow the user to upload the video. Class is used to assign a class to the button and value to assign a value in text format and not HTML.

:speech_balloon: Message config

Message is used to display the different dialogues following the actions with the button. The content of the message attributes takes into account the HTML format, so you can use tags here :grin:

  • The befor_html is the message display before registration
  • The in_html is the message displayed during the recording
  • The after_html is the message display after registration
  • The erreur_text in Text format and not HTML, is the message that will be displayed if the user does not authorize his webcam and microphone.

:floppy_disk: Download option

You have the possibility to use the download function and in this case the user will be able to download the video once registered. To do this, you need to set true to the download level like this:

var Json_RecordJs={

   'Download': true
}

To not allow the user to download and retrieve the video once he has made the recording, you must put false before download like this:

var Json_RecordJs={

   'Download': false
}

:white_check_mark: Initialization of the plugin

To initialize the plugin, you only need to call the RecordJs_Init() function, which will have to take as parameter the variable Json_RecordJs in the JSON form of parameterization, after importing the RecorderJs resource. It will come down to this:

<script src='RecorderJs.js'></script>

var Json_RecordJs={

  'Start_Btn': {"class":"btn btn-success", "value":"Demarrer l'enrégistrement"},
  'Stop_Btn': { "class":"btn btn-danger", "value":"Sauvegarder"},
  'Next_Btn': { "class":"btn btn-primary", "value":"Étape suivante"},
  'Message': 
  {
        "befor_html":" Démarrer l'enregistrement ",
        "in_html":"<p class='alert alert-danger'>En cours d'enregistrement</p>",
        "after_html":"<p class='alert alert-success'>Enregistrement ok</p>",
        "erreur_text":"Autorisé la webcam pour continuer"
  },

  'Download': true
}

RecordJs_Init(Json_RecordJs)

:red_circle:Highly important

If you are not using the download function, i.e. the value assigned to Download is false, you need to add this code to generate a form that would return the url of the video once the user has submitted the video :

 
 document.querySelector('#next-rec').onclick=(e)=>{
  var url_video=document.querySelector('#Url_video').value
  e.preventDefault()
  console(url_video)
}

:computer:Code example

Sample code (with download)

view example online


<script type="text/javascript" src="RecordJs.js"></script>

<script type="text/javascript">

var Json_RecordJs={
 'Start_Btn': {'class':'btn btn-success', 'value':'Démarrer l\'enregistrement'},
 'Stop_Btn': { "class":"btn btn-danger", "value":"Sauvegarder"},
 'Next_Btn': { "class":"btn btn-primary", "value":"Étape suivante"},
 'Message': 
 {
       "befor_html":" Démarrer l'enrégistrement ",
       "in_html":"<p class='alert alert-danger'>En cours d'enregistrement</p>",
       "after_html":"<p class='alert alert-success'>Enrégistrement ok</p>",
       "erreur_text":"Autorisé la webcam pour contunier"
 },

 'Download': true
}

RecordJs_Init(Json_RecordJs)

</script>

Sample code (no download)

view example online


<script type="text/javascript" src="RecordJs.js"></script>

<script type="text/javascript">

var Json_RecordJs={
 'Start_Btn': {'class':'btn btn-success', 'value':'Démarrer l\'enregistrement'},
 'Stop_Btn': { "class":"btn btn-danger", "value":"Sauvégarder"},
 'Next_Btn': { "class":"btn btn-primary", "value":"Étape suivante"},
 'Message': 
 {
       "befor_html":" Démarrer l'enregistrement ",
       "in_html":"<p class='alert alert-danger'>En cours d'enregistrement</p>",
       "after_html":"<p class='alert alert-success'>Enregistrement ok</p>",
       "erreur_text":"Autorisé la webcam pour contunier"
 },

 'Download': false
}

RecordJs_Init(Json_RecordJs)

document.querySelector('#next-rec').onclick=(e)=>{
var url_video=document.querySelector('#Url_video').value
 e.preventDefault()
 console(url_video)
}

</script>