Socket
Socket
Sign inDemoInstall

@bugsounet/cast

Package Overview
Dependencies
7
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @bugsounet/cast

node cast library (DIAL protocol)


Version published
Maintainers
1
Created

Readme

Source

cast

single node routine for casting YouTube (or other ?) in webview tag

Installation

npm install @bugsounet/cast

Sample with cast contructor

const Cast = require("./index.js")

this.config = {
  castName: "MagicMirror_Cast",
  port: 8569
}

var debug = true

this.cast= new Cast(this.config.cast, callback, debug)
this.cast.start()

setTimeout(() => { this.cast.stop() } , 30 * 1000)

function callback(noti, castLink) {
  if (noti == "CAST_START") console.log("Open this link:", castLink)
  if (noti == "CAST_STOP") console.log ("Cast End")
}

/** Note: Open the castLink in a <webview> tag **/
/** needed useragent= "Mozilla/5.0 (SMART-TV; Linux; Tizen 2.4.0) AppleWebkit/538.1 (KHTML, like Gecko) SamsungBrowser/1.1 TV Safari/538.1" **/

constructor of cast

Cast(castConfig, callback, debug)

castConfig {}

  • castName - Name of your device for reconize it in Cast apps
  • port - server port
  • CAST_START - return the url for start casting in a webview frame
  • CAST_STOP - return end of casting

debug

if you want debuging information, just set to true

Functions

  • start() : start cast listener
  • stop() : force stop cast server

Notes

  • Actually only YouTube works but may be other (in another update...)

Keywords

FAQs

Last updated on 02 Oct 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc