GithubHelp home page GithubHelp logo

nvdnkpr / clappr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from clappr/clappr

0.0 1.0 0.0 6.25 MB

An extensible media player for the web

Home Page: http://clappr.io

License: BSD 3-Clause "New" or "Revised" License

JavaScript 95.92% CSS 2.69% ActionScript 1.36% Shell 0.03%

clappr's Introduction

Clappr Player

Build Status Dependency Status

Using the Player

Add the following scripts on your HTML:

<head>
  <script type="text/javascript" charset="utf-8" src="http://cdn.clappr.io/j/vendor/jquery.min.js"></script>
  <script type="text/javascript" charset="utf-8" src="http://cdn.clappr.io/j/vendor/underscore-min.js"></script>
  <script type="text/javascript" charset="utf-8" src="http://cdn.clappr.io/latest/clappr.min.js"> </script>
</head>

Now, create the player:

<body>
  <div id="player"></div>
  <script>
    var playerEl = document.getElementById("player");
    var player = new Clappr.Player({source: "http://your.video/here.mp4"});
    player.attachTo(playerEl);
  </script>
</body>

⚠️ Note that is not necessary to add underscore or jquery scripts if your website already have it.

Formats Supported

Format IE10 IE11 Firefox Chrome Safari iPhone iPad Android
HLS ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
MP4 ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
MP3 ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
DASH ✖️ ✖️ ✖️ ✖️ ✖️ ✖️ ✖️ ✖️
RTMP ✔️ ✔️ ✔️ ✔️ ✔️ ✖️ ✖️ ✖️

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.

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.

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 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" repoository

⚠️ Be sure to merge the latest from "upstream" before making a pull request.

clappr's People

Contributors

flavioribeiro avatar svanscho avatar towerz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.