문제

I am using the HelloTextGoogleCast sample's receiver.html. But I need to set the message bus's message type to JSON.

Here is part of it.

    // create a CastMessageBus to handle messages for a custom namespace
    window.messageBus =
      window.castReceiverManager.getCastMessageBus(
          'urn:x-cast:com.google.cast.sample.helloworld');

I tried this right after the above code. But it does not work:

 window.messageBus = window.castReceiverManager.getCastMessageBus(cast.receiver.CastMessageBus.MessageType.JSON);
도움이 되었습니까?

해결책

Use

window.messageBus = window.castReceiverManager.getCastMessageBus( 'urn:x-cast:com.google.cast.sample.helloworld', cast.receiver.CastMessageBus.MessageType.JSON);

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top