INNER CODE UNIT · JavaScript
onMessage
PierfrancescoSoffritti/android-youtube-player · chromecast-receiver/js/io/SenderMessagesDispatcher.js:10
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()
}
else if(message.data.command === communicationConstants.PAUSE) {
callbacks.pauseVideo()