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

Streaming media

This recipe covers another interesting feature that can be implemented using the WebRTC stack: streaming prerecorded media from one peer to another one.

Getting ready

We will stream a prerecorded WebM file, so you need to have one. You can download demo WebM files from the Internet. For example, from http://www.webmfiles.org/demo-files/.

In this recipe, we will create two files: an HTML page and a JavaScript library.

Note

This feature doesn't work on the local filesystem. To implement this feature, you need to have a web server where you can place all the application files, and where the application is accessible to the customer.

A signaling server is also necessary for this recipe. You can use the server from Chapter 1, Peer Connections.

How to do it…

Open your text editor, and let's create the HTML page by following the given steps:

  1. Make a simple HTML header:
    <!DOCTYPE html>
    <html>
    <head>
        <title>My WebRTC file media streaming demo&lt...

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