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

clappr

Package Overview
Dependencies
Maintainers
3
Versions
235
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clappr

An extensible media player for the web

  • 0.0.73
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.1K
increased by1.93%
Maintainers
3
Weekly downloads
 
Created
Source

Clappr Player

Build Status Dependency Status

Using the Player

Add the following script on your HTML:

<head>
  <script type="text/javascript" src="http://cdn.clappr.io/latest/clappr.min.js"></script>
</head>

Now, create the player:

<body>
  <div id="player"></div>
  <script>
    var player = new Clappr.Player({source: "http://your.video/here.mp4", parentId: "#player"});
  </script>
</body>

Formats Supported

FormatHLSMP4MP3DASHRTMP
IE10:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_multiplication_x::heavy_check_mark:
IE11:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_multiplication_x::heavy_check_mark:
Firefox:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_multiplication_x::heavy_check_mark:
Chrome:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_multiplication_x::heavy_check_mark:
Safari:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_multiplication_x::heavy_check_mark:
iPhone:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_multiplication_x::heavy_multiplication_x:
iPad:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_multiplication_x::heavy_multiplication_x:
Android:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_multiplication_x::heavy_multiplication_x:
WiiU Browser:heavy_check_mark::heavy_check_mark::heavy_multiplication_x::heavy_multiplication_x::heavy_multiplication_x:
PS4 Browser:heavy_check_mark::heavy_check_mark::heavy_multiplication_x::heavy_multiplication_x::heavy_multiplication_x:

Built-in Plugins & Embed Parameters

All parameters listed below shall be added on Clappr.Player object instantiation. Example:

var player = new Clappr.Player({
  source: "http://your.video/here.mp4",
  parameter1: "value1",
  parameter2: "value2",
});
Player Size

You can set the player size setting width and height parameters.

Auto Play

Add autoPlay: true if you want the video to automatic play after page load.

Auto Play when Visible

If you want to play the video when it appears partially on screen, set autoPlayVisible: 'partial'. In case you want the player to play when it is full visible, autoPlayVisible: 'full'.

Mute

Add mute: true if you want to start player with no sound.

Preload

In case you're loading a on demand video (mp4), it's possible to define the way the video will be preloaded according to preload attribute options. Add preload: <type> on embed parameters. By default, Clappr will try to download only video metadata (preload: 'metadata').

Google Analytics Plugin

Enable Google Analytics events dispatch (play/pause/stop/buffering/etc) adding your gaAccount. Optionally, pass your favorite trackerName as gaTrackerName. Example:

  var player = new Clappr.Player({
    source: "http://your.video/here.mp4",
		gaAccount: 'UA-44332211-1',
		gaTracker: 'MyPlayerInstance'
  });
Control bar colors

Customize control bar colors adding mediacontrol hash. Example:

  var player = new Clappr.Player({
    source: "http://your.video/here.mp4",
    mediacontrol: {seekbar: "#E113D3", buttons: "#66B2FF"}
  });

Result:

Clappr with modified media control colors

I'm sure you can do better than me.

Media Control Auto Hide

If you want to disable media control auto hide, add hideMediaControl: false in your embed parameters.

Watermark

Put watermark: http://url/img.png on your embed parameters to automatically add watermark on your video. Choose corner position by defining position parameter. Positions can be bottom-left, bottom-right, top-left and top-right. Example:

  var player = new Clappr.Player({
    source: "http://your.video/here.mp4",
    watermark: "http://url/img.png", position: 'top-right'
  });
Poster

Define a poster by adding poster: http://url/img.png on your embed parameters. It will appear after video embed, disappear on play and go back when user stops the video.

Stats

Clappr has a native statistics plugin that accounts QoE metrics such playing time, rebuffering time, total rebuffers, etc. Metrics report happens periodically, learn how to access these numbers on Create your own plugin session.

Status

Clappr is under heavy development but production-ready. Feel free to open issues and send us pull requests.

Installing for development

Clone the project and install gulp:

npm install -g gulp

Then enter the project directory and install the dependencies:

npm install

Make your changes and run the tests:

npm test

Build your own version:

gulp build

Check the result on dist/ folder.

Contributors

The culprits of this project are listed here.

Contributing

In general, we follow the fork-and-pull git workflow:

  1. Fork the repository on GitHub
  2. Commit changes to a branch in your fork
  3. Pull request "upstream" with your changes
  4. Merge changes in to "upstream" repository

:warning: Be sure to merge the latest from "upstream" before making a pull request.

FAQs

Package last updated on 23 Dec 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