Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
WebRTC Blueprints

You're reading from   WebRTC Blueprints Develop your very own media applications and services using WebRTC

Arrow left icon
Product type Paperback
Published in May 2014
Publisher
ISBN-13 9781783983100
Length 176 pages
Edition Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Andrii Sergiienko Andrii Sergiienko
Author Profile Icon Andrii Sergiienko
Andrii Sergiienko
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

WebRTC Blueprints
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
1. Developing a WebRTC Application FREE CHAPTER 2. Using the WebRTC Data API 3. The Media Streaming and Screen Casting Services 4. Security and Authentication 5. Mobile Platforms Index

Introducing the HTML5 File API


Data channels help us to transmit data (files) between peers. Nevertheless, it doesn't provide any mechanism to read and write files. So, we need some mechanism to be able to read/write files.

For the purpose of filesystem access, we will use the HTML5 File API. It provides a standard way to interact with local files. Using this API, you can create and read files, create thumbnails for image files, save application preferences, and more. You can also verify on the client side; if a customer wants to upload the MIME type of file, you can restrict the uploading by the file size.

When reading files, we will use the FileReader object. It reads files asynchronously and provides the following four ways (methods) to read them:

  • readAsBinaryString: This will read a file into a binary string. Every byte is represented by an integer in the range from 0 to 255.

  • readAsText: This reads the file as a text string. By default, the result string is decoded as UTF-8. You can use...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime