質問

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