UNPKG

node-red-contrib-castv2

Version:

A Node-Red node that provides basic Google Cast functionality based on the node-castv2-client package.

34 lines (24 loc) 852 B
"use strict"; const util = require('util'); const MediaReceiverBase = require('./MediaReceiverBase'); const YouTubeController = require('./YouTubeController'); function YouTubeReceiver(client, session) { MediaReceiverBase.apply(this, arguments); var self = this; this.youtube = this.createController(YouTubeController); this.youtube.on('status', onstatus); function onstatus(status) { self.emit('status', status); } } YouTubeReceiver.APP_ID = '233637DE'; util.inherits(YouTubeReceiver, MediaReceiverBase); YouTubeReceiver.prototype.close = function() { this.youtube.close(); this.youtube = null; MediaReceiverBase.prototype.close.call(this); }; YouTubeReceiver.prototype.load = function(videoId, callback) { this.youtube.load.apply(this.youtube, arguments); }; module.exports = YouTubeReceiver;