Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/videojs/videojs-media-session
Media Session API plugin
https://github.com/videojs/videojs-media-session
media-session media-session-api playlist videojs videojs-playlist
Last synced: 4 months ago
JSON representation
Media Session API plugin
- Host: GitHub
- URL: https://github.com/videojs/videojs-media-session
- Owner: videojs
- License: mit
- Created: 2017-02-17T06:00:16.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-10-06T11:27:42.000Z (about 3 years ago)
- Last Synced: 2024-06-22T18:47:51.263Z (6 months ago)
- Topics: media-session, media-session-api, playlist, videojs, videojs-playlist
- Language: JavaScript
- Homepage: https://videojs.github.io/videojs-media-session/
- Size: 217 KB
- Stars: 8
- Watchers: 16
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# videojs-media-session
Media Sessions API
This is an experimental videojs plugin that interfaces videojs, [videojs-playlist][], and Chrome's newly announced [Media Session API] [implementation][].
## Table of Contents
## Installation
```sh
npm install --save videojs-media-session
```## Usage
To include videojs-media-session on your website or web application, use any of the following methods.
### `` Tag
This is the simplest case. Get the script in whatever way you prefer and include the plugin _after_ you include [video.js][videojs], so that the `videojs` global is available.
```html
<script src="//path/to/video.min.js">var player = videojs('my-video');
player.mediaSession();
```
### Browserify
When using with Browserify, install videojs-media-session via npm and `require` the plugin as you would any other module.
```js
var videojs = require('video.js');// The actual plugin function is exported by this module, but it is also
// attached to the `Player.prototype`; so, there is no need to assign it
// to a variable.
require('videojs-media-session');var player = videojs('my-video');
player.mediaSession();
```### RequireJS/AMD
When using with RequireJS (or another AMD library), get the script in whatever way you prefer and `require` the plugin as you normally would:
```js
require(['video.js', 'videojs-media-session'], function(videojs) {
var player = videojs('my-video');player.mediaSession();
});
```## License
MIT. Copyright (c) Gary Katsevman <[email protected]>
[videojs]: http://videojs.com/
[videojs-playlist]: https://github.com/brightcove/videojs-playlist
[Media Session API]: https://wicg.github.io/mediasession/
[implementation]: https://developers.google.com/web/updates/2017/02/media-session