INNER CODE UNIT · JavaScript
sendMessage
PierfrancescoSoffritti/android-youtube-player · chromecast-receiver/js/io/ChromecastCommunicationChannel.js:6
function sendMessage(data) {
if(!isMessagePoperlyFormatted(data)) {
console.error("object not properly formatted.")
console.error(data)
return;
}
context.getSenders().forEach( sender => context.sendCustomMessage(namespace, sender.id, data) )
}
return {
sendMessage: sendMessage
}
}
export default ChromecastCommunicationChannel