-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.json
37 lines (37 loc) · 7.25 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{
"name": "chromecast-js",
"version": "0.1.8",
"homepage": "",
"description": "Chromecast/Googlecast streaming module all in JS",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/captainyarr/chromecast-js.git"
},
"keywords": [
"chromecast",
"googlecast",
"stream",
"streaming",
"torrentv"
],
"author": {
"name": "Original Source Popcorn Time - ddaf",
"email": "ddaf@popcorntime.io"
},
"license": "ISC",
"bugs": {
"url": "https://github.com/captainyarr/chromecast-js/issues"
},
"dependencies": {
"castv2-client": "^1.1.0",
"debug": "^2.2.0",
"node-ssdp": "^2.4.0"
},
"readme": "chromecast-js\n=================\n\nchromecast-js is a javascript client library for googlecast's remote playback protocol that uses DefaultMediaReceiver to play any (compatible) content in the Chromecast, it works by wrapping the [node-castv2-client](https://github.com/thibauts/node-castv2-client) module.\n\n## Installation\n\nFrom npm:\n\n\tnpm install chromecast-js \n\n## Usage\n\n``` javascript\nchromecastjs = require('chromecast-js');\n\nvar browser = new chromecastjs.Browser();\n\nbrowser.on('deviceOn', function(device) {\n\tdevice.connect();\n\tdevice.on('connected', function() {\n\n\t\tdevice.play('http://commondatastorage.googleapis.com/gtv-videos-bucket/big_buck_bunny_1080p.mp4', 60, function() {\n\t\t\tconsole.log('Playing big_buck_bunny on your chromecast!')\n\t\t});\n\n\t\tsetTimeout(function() {\n\t\t\tdevice.pause(function() {\n\t\t\t\tconsole.log('Paused!');\n\t\t\t});\n\t\t}, 30000);\n\n\t\tsetTimeout(function() {\n\t\t\tdevice.stop(function() {\n\t\t\t\tconsole.log('Stoped!');\n\t\t\t});\n\t\t}, 40000);\n\n\t});\n});\n\n```\n\n## Subtitles and Cover\n\nTo include subtitles and a cover image with the media title, use an Object instead of a string in the *play method*:\n\n``` javascript\n\nchromecastjs = require('../');\n\nvar browser = new chromecastjs.Browser();\n\nvar media = {\n\turl : 'http://commondatastorage.googleapis.com/gtv-videos-bucket/big_buck_bunny_1080p.mp4',\n\tsubtitles: [\n\t\t{\n\t\t\tlanguage: 'en-US',\n\t\t\turl: 'http://carlosguerrero.com/captions_styled.vtt',\n\t\t\tname: 'English'\n\t\t},\n\t\t{\n\t\t\tlanguage: 'es-ES',\n\t\t\turl: 'http://carlosguerrero.com/captions_styled_es.vtt',\n\t\t\tname: 'Spanish'\n\t\t}\n\t],\n\tcover: {\n\t\ttitle: 'Big Bug Bunny',\n\t\turl: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/BigBuckBunny.jpg'\n\t},\n\tsubtitles_style: { \n\t\tbackgroundColor: '#FFFFFFFF', // see http://dev.w3.org/csswg/css-color/#hex-notation\n\t\tforegroundColor: '#000FFFF', // see http://dev.w3.org/csswg/css-color/#hex-notation\n\t\tedgeType: 'DROP_SHADOW', // can be: \"NONE\", \"OUTLINE\", \"DROP_SHADOW\", \"RAISED\", \"DEPRESSED\"\n\t\tedgeColor: '#AA00FFFF', // see http://dev.w3.org/csswg/css-color/#hex-notation\n\t\tfontScale: 1.5, // transforms into \"font-size: \" + (fontScale*100) +\"%\"\n\t\tfontStyle: 'BOLD_ITALIC', // can be: \"NORMAL\", \"BOLD\", \"BOLD_ITALIC\", \"ITALIC\",\n\t\tfontFamily: 'Droid Sans',\n\t\tfontGenericFamily: 'CURSIVE', // can be: \"SANS_SERIF\", \"MONOSPACED_SANS_SERIF\", \"SERIF\", \"MONOSPACED_SERIF\", \"CASUAL\", \"CURSIVE\", \"SMALL_CAPITALS\",\n\t\twindowColor: '#AA00FFFF', // see http://dev.w3.org/csswg/css-color/#hex-notation\n\t\twindowRoundedCornerRadius: 10, // radius in px\n\t\twindowType: 'ROUNDED_CORNERS' // can be: \"NONE\", \"NORMAL\", \"ROUNDED_CORNERS\"\n\t}\n};\n\n\nbrowser.on('deviceOn', function(device) {\n\tdevice.connect();\n\tdevice.on('connected', function() {\n\n\t\t// Starting to play Big Buck Bunny (made in Blender) exactly in the first minute without subtitles or cover.\n\t\t//device.play('http://commondatastorage.googleapis.com/gtv-videos-bucket/big_buck_bunny_1080p.mp4', 60, function(){\n\t\t// console.log('Playing in your chromecast!')\n\t\t//});\n\n\t\t// Starting to play Big Buck Bunny (made in Blender) exactly in the first minute with example subtitles and cover.\n\t\tdevice.play(media, 0, function(){\n\t\t\tconsole.log('Playing in your chromecast!')\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tconsole.log('subtitles off!')\n\t\t\t\tdevice.subtitlesOff(function(err,status){\n\t\t\t\t\tif(err) console.log(\"error setting subtitles off...\")\n\t\t\t\t\tconsole.log(\"subtitles removed.\")\n\t\t\t\t});\n\t\t\t}, 20000);\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tconsole.log('subtitles on!')\n\t\t\t\tdevice.changeSubtitles(1, function(err, status){\n\t\t\t\t\tif(err) console.log(\"error restoring subtitles...\")\n\t\t\t\t\tconsole.log(\"subtitles restored.\")\n\t\t\t\t});\n\t\t\t}, 25000);\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tconsole.log('subtitles on!')\n\t\t\t\tdevice.changeSubtitles(1, function(err, status){\n\t\t\t\t\tif(err) console.log(\"error restoring subtitles...\")\n\t\t\t\t\tconsole.log(\"subtitles restored.\")\n\t\t\t\t});\n\t\t\t}, 25000);\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tdevice.pause(function(){\n\t\t\t\t\tconsole.log('Paused!')\n\t\t\t\t});\n\t\t\t}, 30000);\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tdevice.unpause(function(){\n\t\t\t\t\tconsole.log('unpaused!')\n\t\t\t\t});\n\t\t\t}, 40000);\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tconsole.log('I ment English subtitles!')\n\t\t\t\tdevice.changeSubtitles(0, function(err, status){\n\t\t\t\t\tif(err) console.log(\"error restoring subtitles...\")\n\t\t\t\t\tconsole.log(\"English subtitles restored.\")\n\t\t\t\t});\n\t\t\t}, 45000);\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tconsole.log('Increasing subtitles size...')\n\t\t\t\tdevice.changeSubtitlesSize(10, function(err, status){\n\t\t\t\t\tif(err) console.log(\"error increasing subtitles size...\")\n\t\t\t\t\tconsole.log(\"subtitles size increased.\")\n\t\t\t\t});\n\t\t\t}, 46000);\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tdevice.seek(30,function(){\n\t\t\t\t\tconsole.log('seeking forward!')\n\t\t\t\t});\n\t\t\t}, 50000);\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tconsole.log('decreasing subtitles size...')\n\t\t\t\tdevice.changeSubtitlesSize(1, function(err, status){\n\t\t\t\t\tif(err) console.log(\"error...\")\n\t\t\t\t\tconsole.log(\"subtitles size decreased.\")\n\t\t\t\t});\n\t\t\t}, 60000);\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tdevice.pause(function(){\n\t\t\t\t\tconsole.log('Paused!')\n\t\t\t\t});\n\t\t\t}, 70000);\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tdevice.seek(30,function(){\n\t\t\t\t\tconsole.log('seeking forward!')\n\t\t\t\t});\n\t\t\t}, 80000);\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tdevice.seek(30,function(){\n\t\t\t\t\tconsole.log('seeking forward!')\n\t\t\t\t});\n\t\t\t}, 85000);\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tdevice.unpause(function(){\n\t\t\t\t\tconsole.log('unpaused!')\n\t\t\t\t});\n\t\t\t}, 90000);\n\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tdevice.seek(-30,function(){\n\t\t\t\t\tconsole.log('seeking backwards!')\n\t\t\t\t});\n\t\t\t}, 100000);\n\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tdevice.stop(function(){\n\t\t\t\t\tconsole.log('Stoped!')\n\t\t\t\t});\n\t\t\t}, 200000);\n\t\t});\n\t});\n};\n\n```\n\n",
"readmeFilename": "README.md",
"_id": "chromecast-js@0.1.8",
"_shasum": "ca07ef8d4fdb5ab4a5f1c8e8f113bc448a60cb25",
"_resolved": "git+https://git.popcorntime.io/mirrors/chromecast-js.git#40a805b5d53f43ce8be2b4f696744f58091a9876",
"_from": "chromecast-js@git+https://git.popcorntime.io/mirrors/chromecast-js.git"
}