├── .gitignore ├── CHANGELOG.md ├── Gruntfile.coffee ├── LICENSE.md ├── README.md ├── bower.json ├── demo-server.js ├── demo ├── font │ ├── vjs.eot │ ├── vjs.svg │ ├── vjs.ttf │ └── vjs.woff ├── index.html ├── video-js.css └── video.dev.js ├── dist ├── videojs.chromecast.css ├── videojs.chromecast.js ├── videojs.chromecast.min.css └── videojs.chromecast.min.js ├── lang ├── de.coffee └── it.coffee ├── package.json ├── screenshots └── chromecast-player.jpg └── src ├── videojs.chromecast-component.coffee ├── videojs.chromecast-tech.coffee ├── videojs.chromecast.coffee └── videojs.chromecast.less /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | npm-debug.log 3 | node_modules 4 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | CHANGELOG 2 | ========= 3 | 4 | ## HEAD (Unreleased) 5 | *(no changes)* 6 | 7 | ## 1.1.1 (13.04.2014) 8 | * The Chromecast will no longer stay paused after seeking. (#10) 9 | * If casting is ended while playing, the browser seeks to the last position and plays. (#10) 10 | 11 | ## 1.1.0 (18.02.2014) 12 | * Added `bower.json`. It can now be installed by calling `bower install videojs-chromecast`. (#8) 13 | * Added WebM and HLS support. (#9) 14 | * Fixed compatibility with Video.JS v4.12.0. 15 | 16 | ## 1.0.0 (22.09.2014) 17 | * First release 18 | -------------------------------------------------------------------------------- /Gruntfile.coffee: -------------------------------------------------------------------------------- 1 | module.exports = -> 2 | 3 | # Initialize the configuration 4 | @initConfig 5 | 6 | pkg: @file.readJSON "package.json" 7 | 8 | banner: """ 9 | /*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today('yyyy-mm-dd') %> 10 | * <%= pkg.homepage %> 11 | * Copyright (c) <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>; Licensed <%= pkg.license %> */ 12 | 13 | """ 14 | 15 | clean: 16 | src: "dist/*" 17 | 18 | coffee: 19 | compileJoined: 20 | options: 21 | join: true 22 | files: 23 | "dist/videojs.chromecast.js": [ 24 | "lang/*" 25 | "src/videojs.chromecast.coffee" 26 | "src/videojs.chromecast-component.coffee" 27 | "src/videojs.chromecast-tech.coffee" 28 | ] 29 | 30 | uglify: 31 | options: 32 | compress: 33 | drop_console: true 34 | pure_funcs: ["vjs.log"] 35 | dist: 36 | src: "dist/videojs.chromecast.js" 37 | dest: "dist/videojs.chromecast.min.js" 38 | 39 | less: 40 | development: 41 | files: 42 | "dist/videojs.chromecast.css": "src/videojs.chromecast.less" 43 | 44 | cssmin: 45 | dist: 46 | src: "dist/videojs.chromecast.css" 47 | dest: "dist/videojs.chromecast.min.css" 48 | 49 | usebanner: 50 | options: 51 | position: "top" 52 | banner: "<%= banner %>" 53 | files: 54 | src: [ 55 | "dist/videojs.chromecast.js" 56 | "dist/videojs.chromecast.min.js" 57 | "dist/videojs.chromecast.min.css" 58 | "dist/videojs.chromecast.css" 59 | ] 60 | 61 | # Load external Grunt task plugins 62 | @loadNpmTasks "grunt-contrib-clean" 63 | @loadNpmTasks "grunt-contrib-uglify" 64 | @loadNpmTasks "grunt-contrib-cssmin" 65 | @loadNpmTasks "grunt-contrib-coffee" 66 | @loadNpmTasks "grunt-contrib-less" 67 | @loadNpmTasks "grunt-banner" 68 | 69 | # Default task 70 | @registerTask "default", ["clean", "coffee", "uglify", "less", "cssmin", "usebanner"] 71 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 KIM Keep In Mind GmbH, srl 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [VideoJS](http://www.videojs.com) Chromecast Plugin 2 | Displays a Chromecast button in the control bar. The button is only shown if the [Google Cast extension](https://chrome.google.com/webstore/detail/google-cast/boadgeojelhgndaghljhdicfkmllpafd) is installed and a Chromecast is currently available. 3 | 4 | ![video player](https://raw.githubusercontent.com/kim-company/videojs-chromecast/master/screenshots/chromecast-player.jpg) 5 | 6 | ## Getting started 7 | **NOTE:** The Chromecast Plugin won't work if you open the index.html in the browser. It must run on a webserver. 8 | 9 | 1. Add `data-cast-api-enabled="true"` in your `` Tag. 10 | 2. Include `videojs.chromecast.css` and `videojs.chromecast.js` in the ``. 11 | 3. Initialize the VideoJS Player with the Chromecast Plugin like the [configuration example](#configuration-example). 12 | 4. When a Chromecast is available in your network, you should see the cast button in the controlbar. 13 | 14 | If you are not able to configure the player, check out the [demo directory](https://github.com/kim-company/videojs-chromecast/tree/master/demo). 15 | 16 | #### Configuration example 17 | ```javascript 18 | videojs("my_player_id", { 19 | plugins: { 20 | chromecast: { 21 | appId: "AppID of your Chromecast App", 22 | metadata: { 23 | title: "Title", 24 | subtitle: "Subtitle" 25 | } 26 | } 27 | } 28 | }); 29 | ``` 30 | 31 | ## Contributing 32 | [![david-dm](http://img.shields.io/david/dev/kim-company/videojs-chromecast.svg?style=flat)](https://david-dm.org/kim-company/videojs-chromecast/) 33 | 34 | Ensure that you have installed [Node.js](http://www.nodejs.org) and [npm](http://www.npmjs.org/) 35 | 36 | Test that Grunt's CLI is installed by running `grunt --version`. If the command isn't found, run `npm install -g grunt-cli`. For more information about installing Grunt, see the [getting started guide](http://gruntjs.com/getting-started). 37 | 38 | 1. Fork and clone the repository. 39 | 2. Run `npm install` to install the dependencies. 40 | 3. Run `grunt` to grunt this project. 41 | 42 | #### You can test your changes with the included demo 43 | 1. Run `node demo-server.js` to start the server. 44 | 2. See `http://localhost:3000/demo/` in your browser. 45 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "videojs-chromecast", 3 | "version": "1.1.1", 4 | "homepage": "https://github.com/kim-company/videojs-chromecast", 5 | "author": { 6 | "name": "KIM Keep In Mind GmbH, srl", 7 | "email": "info@keepinmind.info" 8 | }, 9 | "description": "Videojs plugin for chromecast", 10 | "main": [ 11 | "dist/videojs.chromecast.min.js", 12 | "dist/videojs.chromecast.min.css" 13 | ], 14 | "license": "MIT", 15 | "ignore": [ 16 | "**/.*", 17 | "node_modules", 18 | "bower_components", 19 | "test", 20 | "tests" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /demo-server.js: -------------------------------------------------------------------------------- 1 | var express = require("express"); 2 | var app = express(); 3 | 4 | app.use(express.static(__dirname)); 5 | 6 | app.listen(3000); 7 | console.log("Listening on port 3000"); 8 | -------------------------------------------------------------------------------- /demo/font/vjs.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kim-company/videojs-chromecast/72b141247ad83230e602c199d76475bdeb22f179/demo/font/vjs.eot -------------------------------------------------------------------------------- /demo/font/vjs.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by IcoMoon 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /demo/font/vjs.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kim-company/videojs-chromecast/72b141247ad83230e602c199d76475bdeb22f179/demo/font/vjs.ttf -------------------------------------------------------------------------------- /demo/font/vjs.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kim-company/videojs-chromecast/72b141247ad83230e602c199d76475bdeb22f179/demo/font/vjs.woff -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Demo - VideoJS Chromecast Plugin 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 24 | 25 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /demo/video-js.css: -------------------------------------------------------------------------------- 1 | /*! 2 | Video.js Default Styles (http://videojs.com) 3 | Version 4.12.5 4 | Create your own skin at http://designer.videojs.com 5 | */ 6 | /* SKIN 7 | ================================================================================ 8 | The main class name for all skin-specific styles. To make your own skin, 9 | replace all occurrences of 'vjs-default-skin' with a new name. Then add your new 10 | skin name to your video tag instead of the default skin. 11 | e.g.