INNER CODE UNIT · JavaScript
SenderMessagesDispatcher
PierfrancescoSoffritti/android-youtube-player · chromecast-receiver/js/io/SenderMessagesDispatcher.js:8
function SenderMessagesDispatcher(communicationConstants, callbacks) {
function onMessage(message) {
console.log(message.data)
if(message.data.command === INIT_COMMUNICATION_CONSTANTS) {
callbacks.onInitMessageReceived(message.data.communicationConstants)
}
else if(message.data.command === communicationConstants.LOAD) {
callbacks.loadVideo(message.data.videoId, Number(message.data.startSeconds))
}
else if(message.data.command === communicationConstants.CUE) {
callbacks.cueVideo(message.data.videoId, Number(message.data.startSeconds))
}
else if(message.data.command === communicationConstants.PLAY) {
callbacks.playVideo()
}