Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Snyk] Fix for 1 vulnerabilities #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
},
"dependencies": {
"castv2-client": "^1.1.0",
"debug": "^2.2.0",
"node-ssdp": "^2.4.0"
"debug": "^3.1.0",
"node-ssdp": "^3.3.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",
Expand Down