All Projects β†’ openplayerjs β†’ Openplayerjs

openplayerjs / Openplayerjs

Licence: mit
Lightweight HTML5 video/audio player with smooth controls and ability to play VAST/VPAID/VMAP ads

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Openplayerjs

Video.js
Video.js - open source HTML5 & Flash video player
Stars: ✭ 32,478 (+12636.47%)
Mutual labels:  player, dash, html5-video, html5-audio, hls, html5
Html5 Dash Hls Rtmp
🌻 HTML5播放器、M3U8η›΄ζ’­/点播、RTMPη›΄ζ’­γ€δ½Žε»ΆθΏŸγ€ζŽ¨ζ΅/ζ’­ζ΅εœ°ε€ι‰΄ζƒ
Stars: ✭ 1,805 (+607.84%)
Mutual labels:  player, dash, html5-video, hls, html5
Mediaelement
HTML5 <audio> or <video> player with support for MP4, WebM, and MP3 as well as HLS, Dash, YouTube, Facebook, SoundCloud and others with a common HTML5 MediaElement API, enabling a consistent UI in all browsers.
Stars: ✭ 7,767 (+2945.88%)
Mutual labels:  dash, html5-video, html5-audio, hls, html5
Clappr
🎬 An extensible media player for the web.
Stars: ✭ 5,436 (+2031.76%)
Mutual labels:  player, dash, html5-video, html5-audio, hls
Vime
Customizable, extensible, accessible and framework agnostic media player. Modern alternative to Video.js and Plyr. Supports HTML5, HLS, Dash, YouTube, Vimeo, Dailymotion...
Stars: ✭ 1,928 (+656.08%)
Mutual labels:  audio, player, dash, hls, html5
Awesome Video
A curated list of awesome streaming video tools, frameworks, libraries, and learning resources.
Stars: ✭ 397 (+55.69%)
Mutual labels:  audio, player, dash, hls
React Player
A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion
Stars: ✭ 5,931 (+2225.88%)
Mutual labels:  audio, player, dash, hls
Mediaelement Plugins
Plugins for the main mediaelement project
Stars: ✭ 328 (+28.63%)
Mutual labels:  audio, dash, html5-video, hls
React Cassette Player
Simple ReactJS HTML5 audio player component built with SVG icons from The Noun Project.
Stars: ✭ 93 (-63.53%)
Mutual labels:  audio, player, html5-audio, html5
Xgplayer
A HTML5 video player with a parser that saves traffic
Stars: ✭ 4,792 (+1779.22%)
Mutual labels:  player, dash, html5-video, hls
Magicalexoplayer
The Easiest Way To Play/Stream Video And Audio Using Google ExoPlayer In Your Android Application
Stars: ✭ 171 (-32.94%)
Mutual labels:  audio, player, dash, hls
nsplayer
A web player with shakaplayer & hls.js both supported
Stars: ✭ 23 (-90.98%)
Mutual labels:  player, hls, dash
Wjplayer
Video.js bundle that supports HLS, VAST/VMAP, 360-degree videos, and more.
Stars: ✭ 55 (-78.43%)
Mutual labels:  audio, player, hls
Muse
🎧 All you need is a simple and diligent HTML 5 music player written in React.
Stars: ✭ 82 (-67.84%)
Mutual labels:  audio, player, html5
React Music Player
🎡 Maybe the best beautiful HTML5 responsive player component for react :)
Stars: ✭ 321 (+25.88%)
Mutual labels:  audio, player, html5
Mediaelement Files
Sample media files (MP4, WebM, Ogv, MP3, etc.) for the MediaElement.js library
Stars: ✭ 92 (-63.92%)
Mutual labels:  audio, dash, hls
P2p Cdn Sdk Javascript
Free p2p cdn github javascript sdk to reduce video streaming costs of live and on demand video using webrtc by upto 90% and improve scalability by 6x - πŸš€ Vadootv πŸš€
Stars: ✭ 158 (-38.04%)
Mutual labels:  player, dash, hls
Sjmediacacheserver
A HTTP Media Caching Framework. It can cache FILE or HLS media. ιŸ³θ§†ι’‘θΎΉζ’­θΎΉηΌ“ε­˜ζ‘†ζžΆ, ζ”―ζŒ HLS(m3u8) ε’Œ FILE(mp4, mp3η­‰).
Stars: ✭ 87 (-65.88%)
Mutual labels:  audio, player, hls
clappr-core
Core components of the Clappr player architecture
Stars: ✭ 41 (-83.92%)
Mutual labels:  player, html5-video, html5-audio
React Jplayer
Html5 audio and video player library for React
Stars: ✭ 128 (-49.8%)
Mutual labels:  audio, html5-video, html5

OpenPlayer.js

openplayerjs

NPM

Tweet JSDelivr Build Status Size Donate

This is a media player that uses all the goods of HTML5 video/audio elements to play the most popular media in MP4/MP3, HLS and M(PEG)-DASH, and also has the ability to play VMAP, VAST and VPAID ads.

Advantages

  • Supports IE11+ (Win8) and all modern browsers.
  • No dependencies, since it is written in Typescript.
  • Runs a simple but yet powerful algorithm to check the browser's autoplay capabilities across browsers.
  • Supports for local and remote captions for both video and audio, even without including the crossorigin attribute.
  • Enhance your player adding your own buttons. Check here for more details.
  • Provides the ability to use a single VAST/VPAID source or a VAST/VPAID playlist from several different sources (including URLs and valid XML strings).
  • Can play ads in infinite loop, desired for ads that are in a heavy text page.
  • Always responsive by default, for both video/audio tags; for video, fill and fit modes are available to either scale and crop media relative to its parent container, or to attempt to make the media fit its parent container (including black bars), respectively.

⚠️ IMPORTANT: Migrating from v1.x.x to v2.x.x ⚠️

In order to achieve a smooth upgrading between version 1.x.x and 2.x.x, there is a couple of things to keep in mind:

  1. The player will only accept now 2 parameters instead of 4: the player ID and the player options.
  2. controls and showLiveProgress properties are now complex object structures, where we can indicate visibility and a new set of extra layers/visibility.

To simplify this even more:

v1.x.x

const player = new OpenPlayerJS('player', 'https://ads.example.url/xml', true, {
    controls: {
        left: ['play', 'time', 'volume'],
        middle: ['progress'],
        right: ['captions', 'settings', 'fullscreen'],
    },
    showLiveProgress: false,
    // ...other player options
});
player.init();

v2.x.x

const player = new OpenPlayerJS('player', {
    ads: {
        src: 'https://ads.example.url/xml', // equivalent to the second argument in v1.x.x
        // ...other ads options
    },
    mode: 'fullscreen', // equivalent to `true` in third argument in v1.x.x
    controls: {
        alwaysVisible: false,
        // Also available: `top-left`, `top-middle`,
        // `top-right`, `bottom-left`, `bottom-middle` and `bottom-right` or `main`
        layers: {
            left: ['play', 'time', 'volume'],
            middle: ['progress'],
            right: ['captions', 'settings', 'fullscreen'],
        }
    },
    live: {
        showLabel: true,
        showProgress: false, // equivalent of `showLiveProgress` in v1.x.x
    },
    // ...other player options
});
player.init();

Getting Started

The standard template to start using OpenPlayerJS is show in the following snippet.

<html>
    <head>
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/openplayer.min.css">
    </head>
    <body>
        <video class="op-player__media" id="player" controls playsinline>
            <source src="/path/to/video.mp4" type="video/mp4">
            <track kind="subtitles" src="/path/to/video.vtt" srclang="en" label="English">
        </video>
        <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/openplayer.min.js"></script>
        <script>
            // Check the `API and events` link below for more options
            const player = new OpenPlayerJS('player');
            player.init();
        </script>
    </body>
</html>

Usage and API Guides

If you want to unleash the power of OpenPlayerJS, learn more about OpenPlayerJS by checking the following links.

Code Samples

In 2.x.x, the demo folder is now removed in favor of code samples.

If you need a reference on how to use OpenPlayerJS in some of the most common scenarios, check the following links:

  1. No configuration (only DOM classes)
  2. Minimal configuration
  3. Using fill mode
  4. Using fit mode
  5. Using Ads (linear and non-linear samples)
  6. Removing controls and using preload="none"
  7. Add source after initialization (useful for AJAX)
  8. Fully customized audio player
  9. Playing HLS streaming with DRM (Encryption)
  10. M(PEG)-DASH with Ads
  11. Basic playlist (video and audio)
  12. Ads playlist (multiple URLs)
  13. Retrieve data from audio streaming (HLS)
  14. YouTube video (using plugin)
  15. Addition of a custom control
  16. OpenPlayerJS with Next.js
  17. Using Levels and setting width/height
  18. Trigger Ad manually
  19. Use FLV source (only modern browsers and Android, not iOS)
  20. Using hls.js p2p plugin

Built With

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].