Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nw-f2cwa-play

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nw-f2cwa-play

Ffmpeg to Canvas and Web Audio media playback for Node WebKit.

  • 0.0.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

nw-f2cwa-play

Ffmpeg to Canvas and Web Audio media playback for Node WebKit.

You will need ffmpeg to run this.

Install with npm install nw-f2cwa-play

Module includes precompiled versions of binary memcpy module. Binary memcpy gives great performance boost alowing to play 1080p@60Hz movies. Have not tried 4K.

nw-f2cwa-play will try to load precompiled binary for your combination of version/platform/architecture. following combinations are supported: NW 0.7.5,0.8.4,0.8.6,0.9.2,0.10.0-rc1,0.10.2 for Linux 32/64, Windows 32

I have no OSX machine to prebuild OSX versions and include them in npm module. Contributors are welcome. Here is simple instructions to build for OSX.

nw-f2cwa-play will use pure JS less performant fallback if binary memcpy not available you may build memcpy module for your Node-Webkit version with nw-gyp see Node Webkit WiKi article.

Under Windows place ffmpeg.exe into vendor directory or on any platform pass ffmpeg path to player as option.

var
  Player = require('nw-f2cwa-play').Player,
  player;

player = new Player({
  selector:'#cnv', // selector for canvas to render video
  ffmpegPath: 'ffmpeg' // in case ffmpeg is available on standard path
});

player.openSrc('udp://@239.0.1.2:1234'); // pass stream url (rtp, udp, http ... anything supported by ffmpeg) or file path

// auto start playback
player.on('canplay',function(){
          player.play();
})

player.on('time',function(time){
  // time is current stream time in seconds
});

Seeking for streams allowing seeking (mostly files) is also supported:

  1. Use player.openSrc(url,startPos); to start playback from needed pos. startPos expressed in seconds.
  2. Use player.seek(seekPos); seekPos is also expressed in seconds.

See sample App.

This is experiment as for now. May produce unexpected results. Only files/streams with audio are supported, audio is also downsampled to mono for simpler processing.

Keywords

FAQs

Package last updated on 30 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc