Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying WebRTC Cookbook
  • Table Of Contents Toc
  • Feedback & Rating feedback
WebRTC Cookbook

WebRTC Cookbook

By : Sergiienko
5 (1)
close
close
WebRTC Cookbook

WebRTC Cookbook

5 (1)
By: Sergiienko

Overview of this book

If you are a JavaScript developer with a basic knowledge of WebRTC and software development, but want to explore how to use it in more depth, this book is for you.
Table of Contents (10 chapters)
close
close
9
Index

Implementing the blur effect


This recipe dives into the implementation of the blur effect. If you have worked on graphic editing computer software, then you are likely familiar with this effect.

How to do it…

The following steps will help you understand how to implement the blur effect:

  1. Add a control element to the index web page of your application—using this object we will control the blur effect:

    Blur
    <input type="range" oninput="doBlur(this.valueAsNumber);" value="0" step="1" min="0" max="15">
  2. Add an appropriate JavaScript function:

    function doBlur(val) {
      var v = document.getElementById("localVideo");
      v.style.webkitFilter="blur(" + val + "px)";
    };

    We have added a px postfix for the filter's value—this is because of the blur's intensity that is setting in pixels. Here, localVideo is the ID property of the HTML video tag for the local video playback.

  3. Navigate your web browser to the web page. You will first see the raw, unprocessed video from the web camera, with no filter applied. The...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY