Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • NW.js Essentials
  • Toc
  • feedback
NW.js Essentials

NW.js Essentials

By : Benoit
4.8 (5)
close
NW.js Essentials

NW.js Essentials

4.8 (5)
By: Benoit

Overview of this book

If you are an experienced Node.js developer who wants to create amazing desktop applications using NW.js, this is the book for you. Prior knowledge of HTML5, jQuery, and CSS is assumed.
Table of Contents (11 chapters)
close
10
Index

Handling media files


HTML5 APIs provide a simple way to handle media files such as audio and video. The API implementation is really easy:

<video width="400" controls>
  <source src="video.ogv" type="video/ogg">
</video>
<audio controls>
  <source src="audio.ogg" type="audio/ogg">
</audio>

Between the supported file formats, you can find ogg, ogv, and wav. The codecs included in the pre-built ffmpegsumo library are Cotheora, vorbis, vp8, pcm_u8, pcm_s16le, pcm_s24le, pcm_f32le, pcm_s16be and pcm_s24be.

As you have probably already figured out, you're not allowed to play mp3 and mpeg4 files natively as their codecs are proprietary. Unfortunately, there's no easy workaround for the issue. Someone has successfully used the media libraries from Chrome, but I couldn't replicate the process on NW.js 0.11.5. The best way to give support for these codecs to your application is to compile ffmpeg with the corresponding options, but bear in mind that the MP3 and H.264...

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