chromecast receiver <video> element onEnded - chromecast
In my application, a user can restart a video from the beginning after it has ended.
To implement this, I have overridden in the custom receiver the receiver library MediaManager.onEnded() method, and send a custom message to the sender, rather than calling resetMediaElement, which is the default behavior of this method.
At this point, the user hits a play button, and the sender calls the RemoteMediaPlayer.play() method, which should cause the receiver library to call the play() method on the <video> element.
But instead, the receiver library sends back a message saying INVALID REQUEST, INVALID_MEDIA_SESSSION_ID.
Also. the receiver library has logged a message saying "
Unexpected command, player is in the IDLE state so the media session ID is not yet valid
But the last state update from the receiver shows the player in the PLAYING state in both the receiver and sender logs.
Here is the receiver log:
::mmOnLoad() mediacast.js:480
url: http://192.168.1.50/apps/chromecast/videos/Inside%20Diamond%20Head-0001.mp4 mediacast.js:498
duration: 0 mediacast.js:500
::showVideo()- message:[object Object] mediacast.js:257
url:http://192.168.1.50/apps/chromecast/videos/Inside%20Diamond%20Head-0001.mp4 mediacast.js:259
::fadeOutOldMediaElement() mediacast.js:384
::mmOnLoad()- presenting video from http://192.168.1.50/apps/chromecast/videos/Inside%20Diamond%20Head-0001.mp4, duration 0 mediacast.js:552
::fadeOutOldMediaElement0() mediacast.js:393
::videoFadedOut()- url: http://192.168.1.50/apps/chromecast/videos/Inside%20Diamond%20Head-0001.mp4 mediacast.js:265
::videoFadedOut()- setting media element [object HTMLVideoElement] mediacast.js:279
::removeMediaElementOrOverlay() mediacast.js:398
::removeOldMediaElement() mediacast.js:432
::removeOverlay() mediacast.js:427
[ 40.701s] [cast.receiver.MediaManager] Metadata loaded
cast_receiver.javascript:574
[ 40.736s] [cast.receiver.MediaManager] Sending broadcast status message
cast_receiver.javascript:574
>>>>>the media element state is paused mediacast.js:603
media element networkState = 2, readyState = 1 mediacast.js:605
[ 40.802s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.media","senderId":"*:*","data":"{\"type\":\"MEDIA_STATUS\",\"status\":[{\"mediaSessionId\":1,\"playbackRate\":1,\"playerState\":\"PAUSED\",\"currentTime\":0,\"supportedMediaCommands\":15,\"volume\":{\"level\":0.06666666666666667,\"muted\":false},\"media\":{\"customData\":{\"volume\":0.06666666666666667,\"pauseAfter\":true,\"pauseBefore\":true,\"rotation\":0},\"streamType\":\"BUFFERED\",\"duration\":42.4,\"contentType\":\"video/mp4\",\"contentId\":\"http://192.168.1.50/apps/chromecast/videos/Inside%20Diamond%20Head-0001.mp4\",\"metadata\":{\"metadataType\":1}}}],\"requestId\":1}"}
cast_receiver.javascript:574
::videoLoaded() mediacast.js:291
::videoLoaded0() mediacast.js:302
::addVideo() mediacast.js:421
::videoLoaded1() mediacast.js:309
[ 48.434s] [cast.receiver.IpcChannel] Received message: {"data":"{\"type\":\"PLAY\",\"requestId\":2,\"mediaSessionId\":1}","namespace":"urn:x-cast:com.google.cast.media","senderId":"51:name.renkel.james.mediacast-6"}
cast_receiver.javascript:574
[ 48.440s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message [urn:x-cast:com.google.cast.media, 51:name.renkel.james.mediacast-6]: {"type":"PLAY","requestId":2,"mediaSessionId":1}
cast_receiver.javascript:574
[ 48.446s] [cast.receiver.MediaManager] MediaManager message received [51:name.renkel.james.mediacast-6] {"type":"PLAY","requestId":2,"mediaSessionId":1}
cast_receiver.javascript:574
[ 48.449s] [cast.receiver.MediaManager] Dispatching MediaManager play event
cast_receiver.javascript:574
[ 48.457s] [cast.receiver.MediaManager] onPlay
cast_receiver.javascript:574
[ 48.473s] [cast.receiver.MediaManager] Sending broadcast status message
cast_receiver.javascript:574
>>>>>the media element state is buffering mediacast.js:603
media element networkState = 1, readyState = 4 mediacast.js:605
[ 48.491s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.media","senderId":"*:*","data":"{\"type\":\"MEDIA_STATUS\",\"status\":[{\"mediaSessionId\":1,\"playbackRate\":1,\"playerState\":\"BUFFERING\",\"currentTime\":0.033322,\"supportedMediaCommands\":15,\"volume\":{\"level\":0.06666666666666667,\"muted\":false}}],\"requestId\":2}"}
cast_receiver.javascript:574
[ 49.071s] [cast.receiver.MediaManager] Buffering state changed, isPlayerBuffering: false old time: 0.033322 current time: 0.433322
cast_receiver.javascript:574
[ 49.077s] [cast.receiver.MediaManager] Sending broadcast status message
cast_receiver.javascript:574
>>>>>the media element state is playing mediacast.js:603
media element networkState = 2, readyState = 4 mediacast.js:605
[ 49.090s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.media","senderId":"*:*","data":"{\"type\":\"MEDIA_STATUS\",\"status\":[{\"mediaSessionId\":1,\"playbackRate\":1,\"playerState\":\"PLAYING\",\"currentTime\":0.433322,\"supportedMediaCommands\":15,\"volume\":{\"level\":0.06666666666666667,\"muted\":false}}],\"requestId\":0}"}
cast_receiver.javascript:574
::onEnded(VIDEO) mediacast.js:369
::onEnded- network state:1 mediacast.js:370
::onEnded- ready state:4 mediacast.js:371
::onEnded- paused:true mediacast.js:372
::onEnded- ended:true mediacast.js:373
::sendMessage({"indication":"ended"}) mediacast.js:108
[ 90.955s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:name.renkel.james.mediacast","senderId":"51:name.renkel.james.mediacast-6","data":"{\"indication\":\"ended\"}"}
cast_receiver.javascript:574
[110.341s] [cast.receiver.IpcChannel] Received message: {"data":"{\"type\":\"PLAY\",\"requestId\":3,\"mediaSessionId\":1}","namespace":"urn:x-cast:com.google.cast.media","senderId":"51:name.renkel.james.mediacast-6"}
cast_receiver.javascript:574
[110.350s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message [urn:x-cast:com.google.cast.media, 51:name.renkel.james.mediacast-6]: {"type":"PLAY","requestId":3,"mediaSessionId":1}
cast_receiver.javascript:574
[110.358s] [cast.receiver.MediaManager] Unexpected command, player is in IDLE state so the media session ID is not valid yet
cast_receiver.javascript:574ib cast_receiver.javascript:574gb.Gb cast_receiver.javascript:562B.log cast_receiver.javascript:361E cast_receiver.javascript:412Z.M cast_receiver.javascript:1654W.ra cast_receiver.javascript:1181Hb cast_receiver.javascript:885g.dispatchEvent cast_receiver.javascript:856g.M cast_receiver.javascript:1104Hb cast_receiver.javascript:885g.dispatchEvent cast_receiver.javascript:856g.M cast_receiver.javascript:968
[110.362s] [cast.receiver.MediaManager] Sending error message to 51:name.renkel.james.mediacast-6
cast_receiver.javascript:574
[110.368s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.media","senderId":"51:name.renkel.james.mediacast-6","data":"{\"requestId\":3,\"type\":\"INVALID_REQUEST\",\"reason\":\"INVALID_MEDIA_SESSION_ID\"}"}
cast_receiver.javascript:574
And here is the sender log:
11-10 13:36:36.631: D/MC_Sender(15051): ::showVideo()- url: http://192.168.1.50/apps/chromecast/videos/Inside%20Diamond%20Head-0001.mp4 11-10 13:36:36.732: D/MC_MainActivity.PagerAdapter(15051): ::setPrimaryItem(0)
11-10 13:36:36.732: D/MC_MainActivity(15051): ::setContentPosition(0)
11-10 13:36:40.325: D/MC_MediaPlayer(15051): ::onMessageReceived(): device-TV Room; namespace-urn:x-cast:com.google.cast.media; message-{"type":"MEDIA_STATUS","status":[{"mediaSessionId":2,"playbackRate":1,"playerState":"PAUSED","currentTime":0,"supportedMediaCommands":15,"volume":{"level":0.06666666666666667,"muted":false},"media":{"customData":{"volume":0.06666666666666667,"pauseAfter":true,"pauseBefore":true,"rotation":0},"streamType":"BUFFERED","duration":42.4,"contentType":"video/mp4","contentId":"http://192.168.1.50/apps/chromecast/videos/Inside%20Diamond%20Head-0001.mp4","metadata":{"metadataType":1}}}],"requestId":4}
11-10 13:36:40.375: D/MC_Listeners(15051): ::onStatusUpdated()- playerState=PAUSED
11-10 13:36:40.426: D/MC_Runner(15051): ::onSenderStateChange(PAUSED)- runState=LOADING
11-10 13:36:40.426: D/MC_Runner(15051): ::setRunState(RUNNING)- stopWhenRunning=false
11-10 13:36:40.426: D/MC_CastFragment(15051): ::runnerUpdate()
11-10 13:36:40.456: D/MC_Listeners(15051): ::onStatusUpdated()- playerState=PAUSED
11-10 13:36:40.456: D/MC_Listeners(15051): ::onMetadataUpdated()- mediaType=MOVIE
11-10 13:36:40.516: D/MC_MainActivity.PagerAdapter(15051): ::setPrimaryItem(0)
11-10 13:36:40.516: D/MC_MainActivity(15051): ::setContentPosition(0)
11-10 13:36:40.806: D/MC_Sender(15051): ::loadMedia()- statusCode: 0; success: true
11-10 13:36:40.806: D/MC_Runner(15051): LoadCallback::callback(true): wasStopped=false
...
11-10 13:38:47.201: D/MC_Sender(15051): ::playMedia()
11-10 13:38:47.391: D/MC_MediaPlayer(15051): ::onMessageReceived(): device-TV Room; namespace-urn:x-cast:com.google.cast.media; message-{"type":"MEDIA_STATUS","status":[{"mediaSessionId":1,"playbackRate":1,"playerState":"BUFFERING","currentTime":0.033322,"supportedMediaCommands":15,"volume":{"level":0.06666666666666667,"muted":false}}],"requestId":2}
11-10 13:38:47.411: D/MC_Listeners(15051): ::onStatusUpdated()- playerState=BUFFERING
11-10 13:38:47.531: D/MC_Runner(15051): ::onSenderStateChange(BUFFERING)- runState=RUNNING
11-10 13:38:47.671: D/MC_MainActivity.PagerAdapter(15051): ::setPrimaryItem(0)
11-10 13:38:47.671: D/MC_MainActivity(15051): ::setContentPosition(0)
11-10 13:38:48.372: D/MC_Sender(15051): ::playMedia()- statusCode: 0; success: true
11-10 13:38:48.382: D/MC_MediaPlayer(15051): ::onMessageReceived(): device-TV Room; namespace-urn:x-cast:com.google.cast.media; message-{"type":"MEDIA_STATUS","status":[{"mediaSessionId":1,"playbackRate":1,"playerState":"PLAYING","currentTime":0.6,"supportedMediaCommands":15,"volume":{"level":0.06666666666666667,"muted":false}}],"requestId":0}
...
11-10 13:39:29.736: D/MC_Listeners(15051): ::onMessageReceived()- nameSpace: urn:x-cast:name.renkel.james.mediacast; message: {"indication":"ended"}
11-10 13:39:29.806: D/MC_Runner(15051): ::onSenderStateChange(ENDED)- runState=RUNNING
...
11-10 13:42:19.918: D/MC_CastFragment(15051): ::onClick()
11-10 13:42:19.918: D/MC_Sender(15051): ::playMedia()
11-10 13:42:20.398: D/MC_MediaPlayer(15051): ::onMessageReceived(): device-TV Room; namespace-urn:x-cast:com.google.cast.media; message-{"requestId":3,"type":"INVALID_REQUEST","reason":"INVALID_MEDIA_SESSION_ID"}
11-10 13:42:20.418: D/MC_Sender(15051): ::playMedia()- statusCode: 1; success: false
I believe that once the video ends, it goes to an IDLE state whether resetMediaElement is called or not. There's different reasons why the status might be IDLE that you can specify: https://developers.google.com/cast/docs/reference/receiver/cast.receiver.media.IdleReason.
It's a bit roundabout, but based on the methods listed at https://developers.google.com/cast/docs/reference/receiver/cast.receiver.MediaManager, you could:
1) check if the video successfully finished playing
2) set the idle reason as cast.receiver.media.IdleReason.FINISHED
Then, in your sender, you can override customizedStatusCallback() to check the status and idle reason and change the status before sending it to your sender so that it can replay correctly.
Related
RabbitMQ channel.addConfirmListener() , interface ackCallback Some callbacks are missing?
This is my code, channel.addConfirmListener() ackCallback Some callbacks will be lost, The message is indeed sent to the rabbitmq server and can be consumed normally , But I sleep for 2ms after sending the message, and all ack callbacks can be received, I don't know if this is an error in my code or a rabbitmq bug import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; import com.rabbitmq.client.ConnectionFactory; import lombok.extern.log4j.Log4j2; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.concurrent.TimeoutException; #Log4j2 public class 异步确认发布{ public static void main(String[] args) throws IOException, TimeoutException, InterruptedException { ConnectionFactory connectionFactory = new ConnectionFactory(); connectionFactory.setHost(""); connectionFactory.setPort(7005); connectionFactory.setUsername(""); connectionFactory.setPassword(""); Connection connection = connectionFactory.newConnection(); Channel channel = connection.createChannel(); // 开启确认发布 AMQP.Confirm.SelectOk selectOk = channel.confirmSelect(); channel.queueDeclare("hello", true, false, false, null); // 异步确认发布消息 回调 channel.addConfirmListener( (deliveryTag, multiple) -> { log.info("消息deliveryTag=>{}, send successful", deliveryTag); }, (deliveryTag, multiple) -> { log.info("消息deliveryTag=>{}, fail in send", deliveryTag); } ); for (int i = 0; i < 5; i++) { String message = "Hello World!!! " + i; channel.basicPublish("", "hello", null, message.getBytes(StandardCharsets.UTF_8)); } } } The console shows some callbacks missing 17:04:29.607 [AMQP Connection 27.11.210.232:7005] INFO me.demo.me.rabbitmq.consumer.发布确认.异步确认发布 - ackCallback, deliveryTag=>4, send successful 17:04:29.615 [AMQP Connection 27.11.210.232:7005] INFO me.demo.me.rabbitmq.consumer.发布确认.异步确认发布 - ackCallback, deliveryTag=>5, send successful But I sleep for 2ms after sending the message, and all callbacks can be received example code for (int i = 0; i < 5; i++) { String message = "Hello World!!! " + i; channel.basicPublish("", "hello", null, message.getBytes(StandardCharsets.UTF_8)); Thread.sleep(2); // I sleep for 2ms after sending the message, and all ack callbacks can be received } console log 17:05:18.037 [AMQP Connection 27.11.210.232:7005] INFO me.demo.me.rabbitmq.consumer.发布确认.异步确认发布 - ackCallback, deliveryTag=>1, send successful 17:05:18.043 [AMQP Connection 27.11.210.232:7005] INFO me.demo.me.rabbitmq.consumer.发布确认.异步确认发布 - ackCallback, deliveryTag=>2, send successful 17:05:18.043 [AMQP Connection 27.11.210.232:7005] INFO me.demo.me.rabbitmq.consumer.发布确认.异步确认发布 - ackCallback, deliveryTag=>3, send successful 17:05:18.043 [AMQP Connection 27.11.210.232:7005] INFO me.demo.me.rabbitmq.consumer.发布确认.异步确认发布 - ackCallback, deliveryTag=>4, send successful 17:05:18.043 [AMQP Connection 27.11.210.232:7005] INFO me.demo.me.rabbitmq.consumer.发布确认.异步确认发布 - ackCallback, deliveryTag=>5, send successful My RabbitMQ Server Version is 3.9.14 (No configuration has been modified. The default configuration is used), Erlang 24.3.2 , Maven Project dependency in <dependency> <groupId>org.springframework.amqp</groupId> <artifactId>spring-rabbit</artifactId> <version>2.2.18.RELEASE</version> </dependency> I tried to prevent the main thread from shutting down, but it doesn't seem to be the reason for the main thread to shut down, because the main thread won't shut down automatically once the connection is created
I am not sure why you tagged this with spring-rabbit because you are not using the spring-rabbit APIs at all; you are using the amqp-client directly. This is working as designed; for performance reasons, the confirm callback has the additional argument multiple when true; this means that all tags up to and including this one are confirmed with a single confirmation. https://www.rabbitmq.com/tutorials/tutorial-seven-java.html multiple: this is a boolean value. If false, only one message is confirmed/nack-ed, if true, all messages with a lower or equal sequence number are confirmed/nack-ed.
twai/can RX messages receiving is not working is not working in the ESP32-S2 code
SO, I have been trying to test the CAN Bus communication protocol known as "twai" in the esp32-s2 chip. I have the chip - Arduino wires - can transceiver (SN65HVD230). Rx is connected to port4 Tx is connected to port5 the receiving of messages is not working and idk why the following output shows. Failed to receive message Message queued for transmission Failed to receive message Message queued for transmission Failed to receive message Message queued for transmission Failed to receive message Message queued for transmission Failed to receive message Message queued for transmission Failed to receive message Failed to queue message for transmission Failed to receive message Failed to queue message for transmission Failed to receive message Failed to queue message for transmission Failed to receive message Failed to queue message for transmission Failed to receive message Failed to queue message for transmission Failed to receive message Failed to queue message for transmission Failed to receive message Failed to queue message for transmission Failed to receive message Failed to queue message for transmission Failed to receive message Failed to queue message for transmission Failed to receive message Failed to queue message for transmission Failed to receive message Failed to queue message for transmission Failed to receive message Failed to queue message for transmission Failed to receive message Failed to queue message for transmission Failed to receive message Failed to queue message for transmission this is the code i used, idk what is wrong in it, i got the commands from the espressif link https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/twai.html it should be similar to the CAN interface in the regular esp32 chip. this is the code used #include "driver/gpio.h" #include "driver/twai.h" void setup() { Serial.begin(115200); // Initialize configuration structures using macro initializers twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT(GPIO_NUM_5, GPIO_NUM_4, TWAI_MODE_NORMAL); twai_timing_config_t t_config = TWAI_TIMING_CONFIG_250KBITS(); twai_filter_config_t f_config = TWAI_FILTER_CONFIG_ACCEPT_ALL(); // Install TWAI driver if (twai_driver_install(&g_config, &t_config, &f_config) == ESP_OK) { printf("Driver installed\n"); } else { printf("Failed to install driver\n"); return; } // Start TWAI driver if (twai_start() == ESP_OK) { printf("Driver started\n"); } else { printf("Failed to start driver\n"); return; } } void loop() { //Configure message to transmit twai_message_t message; message.identifier =0x12; message.extd =1; message.data_length_code = 8; for (int i = 0; i < 8; i++) { message.data[i] = 0; } //Queue message for transmission if (twai_transmit(&message, pdMS_TO_TICKS(1000)) == ESP_OK) { printf("Message queued for transmission\n"); } else { printf("Failed to queue message for transmission\n"); } delay(2000); twai_message_t messagerx; if (twai_receive(&messagerx, pdMS_TO_TICKS(10000)) == ESP_OK) { printf("Message received\n"); } else { printf("Failed to receive message\n"); return; } //Process received message if (messagerx.extd) { printf("Message is in Extended Format\n"); } else { printf("Message is in Standard Format\n"); } printf("ID is %d\n", messagerx.identifier); if (!(messagerx.rtr)) { for (int i = 0; i < messagerx.data_length_code; i++) { printf("Data byte %d = %d\n", i, message.data[i]); } } }
This is currently a known issue with the ESP32-S2 devices where TWAI receive does not function properly, while transmit will function correctly. It effects v4.3 of the ESP-IDF TWAI driver as of writing this answer. EspressIF will be back porting the fix to v4.3 according to this Github issue; https://github.com/espressif/esp-idf/issues/5604 , however does not yet appear to be complete as the pull request is still marked WIP. I was able to confirm using similar code to yours by switching back to an ESP32 module and receive would then work correctly.
socket.io transport error with websocket transport
I'm trying to set up a socket.io connection, but the connection keeps closing with a transport error message. Both, client and server, are running socket.io v2.0.3. Client var _socket = io({ transports: ['websocket'], query: { token: userToken, roomName: getRoomName(), }, }); messages: socket.io-client:manager attempting reconnect +5s socket.io.min.js:1 socket.io-client:manager readyState closed +0ms socket.io.min.js:1 socket.io-client:manager opening https://video.twoseven.xyz +1ms socket.io.min.js:1 engine.io-client:socket creating transport "websocket" +1ms socket.io.min.js:1 engine.io-client:socket setting transport websocket +1ms socket.io.min.js:1 socket.io-client:manager connect attempt will timeout after 20000 +2ms socket.io.min.js:2 WebSocket connection to 'wss://video.twoseven.xyz/socket.io/?token=abcd&roomName=us&EIO=3&transport=websocket' failed: Invalid frame header r.doOpen # socket.io.min.js:2 r.open # socket.io.min.js:2 r.open # socket.io.min.js:1 r # socket.io.min.js:1 r # socket.io.min.js:1 r.open.r.connect # socket.io.min.js:1 (anonymous) # socket.io.min.js:1 socket.io.min.js:1 engine.io-client:socket socket error {"type":"TransportError","description":{"isTrusted":true}} +733ms socket.io.min.js:1 socket.io-client:manager connect_error +1ms socket.io.min.js:1 socket.io-client:manager cleanup +0ms socket.io.min.js:1 socket.io-client:manager reconnect attempt error +1ms socket.io.min.js:1 socket.io-client:manager will wait 4769ms before reconnect attempt +1ms socket.io.min.js:1 engine.io-client:socket socket close with reason: "transport error" +0ms The Chrome developer console reports the following from the network tab: General Request URL:wss://video.twoseven.xyz/socket.io/?token=abcd&roomName=us&EIO=3&transport=websocket Request Method:GET Status Code:101 Switching Protocols Response Headers Connection:upgrade Date:Thu, 19 Oct 2017 22:36:52 GMT Sec-WebSocket-Accept:YJ3aZ2L+X+ANa1bJK3ECO/s7XVE= Sec-WebSocket-Extensions:permessage-deflate Server:nginx/1.11.8 Upgrade:websocket Server const io = new socketio(server, {pingInterval: 3000, pingTimeout: 10000}); io.set('transports', ['websocket']); messages: engine handshaking client "yrFJADAHt-QQZsX6AAAA" +0ms engine:socket sending packet "open" ({"sid":"yrFJADAHt-QQZsX6AAAA","upgrades":[],"pingInterval":3000,"pingTimeout":10000}) +3ms engine:socket flushing buffer to transport +1ms engine:ws writing "0{"sid":"yrFJADAHt-QQZsX6AAAA","upgrades":[],"pingInterval":3000,"pingTimeout":10000}" +1ms engine:transport setting request +1ms engine:socket sending packet "message" (0) +9ms engine:socket flushing buffer to transport +19ms engine:ws writing "40" +1ms engine:socket sending packet "message" (2["authenticated"]) +91ms engine:socket flushing buffer to transport +0ms engine:ws writing "42["authenticated"]" +1ms engine:socket transport error +136ms engine:ws closing +2ms From the server logs, I see that the connection event has been triggered and executes fine except for the last line which says socket.emit('authenticated');. The transport seems to fail at this point
What happened in chromecast receiver than i get didFailToLoadMediaWithError in sender
then i swoosh media to Chromecast, in app "didFailToLoadMediaWithError" delegate call. didFailToLoadMediaWithError = Error Domain=com.google.GCKError Code=9 "Request is not allowed in this state" UserInfo=0x171871600 {NSLocalizedDescription=Request is not allowed in this state how it catch this error in receiver side? in receiver log i get: [ 37.552s] [goog.net.XhrIo] Will abort after 10000ms if incomple
google cast receiver returns unavailable anyway
i tried some googlecast samples(e.g googlecast/CastHelloText-chrome) but any samples its receiver returns "unavailable" on my custom-receiver. first, default application id in samples(e.g '794B7BBF' ) works good.no problems. registered receiver.html in samples on Google Cast SDK Developer Console, and replace application id to published one, but any receivers found on sender. reboot chromecast, checked "Send this Chromecast's serial number when checking for updates." checkbox, reinitialized chromecast and registered serial number again but they were ineffective. here are console logs on console of chrome developer tools when access receiver.html [ 0.034s] [cast.receiver.CastReceiverManager] Version: 2.0.0.0008 cast_receiver.js:18 Starting Receiver Manager receiver.html:46 [ 0.035s] [cast.receiver.IpcChannel] Opening message bus websocket cast_receiver.js:18 [ 0.036s] [goog.net.WebSocket] Opening the WebSocket on ws://localhost:8008/v2/ipc cast_receiver.js:18 Receiver Manager started receiver.html:91 [ 2.062s] [goog.net.WebSocket] An error occurred: undefined cast_receiver.js:18 [ 2.062s] [cast.receiver.IpcChannel] IpcChannel error cast_receiver.js:18 [ 2.063s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message cast_receiver.js:18 [ 2.064s] [goog.net.WebSocket] The WebSocket on ws://localhost:8008/v2/ipc closed. cast_receiver.js:18 [ 2.064s] [cast.receiver.IpcChannel] IpcChannel closed cast_receiver.js:18 [ 2.064s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message cast_receiver.js:18 [ 2.064s] [goog.net.WebSocket] The WebSocket disconnected unexpectedly: undefined cast_receiver.js:18 [ 2.064s] [goog.net.WebSocket] Seconds until next reconnect attempt: 1 cast_receiver.js:18 [ 3.068s] [goog.net.WebSocket] Opening the WebSocket on ws://localhost:8008/v2/ipc cast_receiver.js:18 [ 5.076s] [goog.net.WebSocket] An error occurred: undefined cast_receiver.js:18 [ 5.076s] [cast.receiver.IpcChannel] IpcChannel error cast_receiver.js:18 [ 5.076s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message cast_receiver.js:18 [ 5.077s] [goog.net.WebSocket] The WebSocket on ws://localhost:8008/v2/ipc closed. cast_receiver.js:18 [ 5.077s] [cast.receiver.IpcChannel] IpcChannel closed cast_receiver.js:18 [ 5.078s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message cast_receiver.js:18 [ 5.078s] [goog.net.WebSocket] The WebSocket disconnected unexpectedly: undefined cast_receiver.js:18 [ 5.079s] [goog.net.WebSocket] Seconds until next reconnect attempt: 2 cast_receiver.js:18 [ 7.080s] [goog.net.WebSocket] Opening the WebSocket on ws://localhost:8008/v2/ipc cast_receiver.js:18 [ 9.083s] [goog.net.WebSocket] An error occurred: undefined cast_receiver.js:18 [ 9.084s] [cast.receiver.IpcChannel] IpcChannel error cast_receiver.js:18 [ 9.084s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message cast_receiver.js:18 [ 9.084s] [goog.net.WebSocket] The WebSocket on ws://localhost:8008/v2/ipc closed. cast_receiver.js:18 [ 9.084s] [cast.receiver.IpcChannel] IpcChannel closed cast_receiver.js:18 [ 9.085s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message cast_receiver.js:18 [ 9.085s] [goog.net.WebSocket] The WebSocket disconnected unexpectedly: undefined cast_receiver.js:18 [ 9.085s] [goog.net.WebSocket] Seconds until next reconnect attempt: 4 cast_receiver.js:18 [ 13.087s] [goog.net.WebSocket] Opening the WebSocket on ws://localhost:8008/v2/ipc cast_receiver.js:18 [ 15.091s] [goog.net.WebSocket] An error occurred: undefined cast_receiver.js:18 [ 15.091s] [cast.receiver.IpcChannel] IpcChannel error cast_receiver.js:18 [ 15.091s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message cast_receiver.js:18 [ 15.091s] [goog.net.WebSocket] The WebSocket on ws://localhost:8008/v2/ipc closed. cast_receiver.js:18 [ 15.092s] [cast.receiver.IpcChannel] IpcChannel closed cast_receiver.js:18 [ 15.092s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message cast_receiver.js:18 [ 15.092s] [goog.net.WebSocket] The WebSocket disconnected unexpectedly: undefined cast_receiver.js:18 [ 15.092s] [goog.net.WebSocket] Seconds until next reconnect attempt: 8 cast_receiver.js:18 [ 23.094s] [goog.net.WebSocket] Opening the WebSocket on ws://localhost:8008/v2/ipc cast_receiver.js:18 [ 25.097s] [goog.net.WebSocket] An error occurred: undefined cast_receiver.js:18 [ 25.098s] [cast.receiver.IpcChannel] IpcChannel error cast_receiver.js:18 [ 25.098s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message cast_receiver.js:18 [ 25.098s] [goog.net.WebSocket] The WebSocket on ws://localhost:8008/v2/ipc closed. cast_receiver.js:18 [ 25.099s] [cast.receiver.IpcChannel] IpcChannel closed cast_receiver.js:18 [ 25.099s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message cast_receiver.js:18 [ 25.099s] [goog.net.WebSocket] The WebSocket disconnected unexpectedly: undefined cast_receiver.js:18 [ 25.099s] [goog.net.WebSocket] Seconds until next reconnect attempt: 16 cast_receiver.js:18 [ 41.675s] [goog.net.WebSocket] Opening the WebSocket on ws://localhost:8008/v2/ipc cast_receiver.js:18 [ 43.679s] [goog.net.WebSocket] An error occurred: undefined cast_receiver.js:18 [ 43.680s] [cast.receiver.IpcChannel] IpcChannel error cast_receiver.js:18 [ 43.680s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message cast_receiver.js:18 [ 43.682s] [goog.net.WebSocket] The WebSocket on ws://localhost:8008/v2/ipc closed. cast_receiver.js:18 [ 43.682s] [cast.receiver.IpcChannel] IpcChannel closed cast_receiver.js:18 [ 43.682s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message cast_receiver.js:18 [ 43.682s] [goog.net.WebSocket] The WebSocket disconnected unexpectedly: undefined cast_receiver.js:18 [ 43.682s] [goog.net.WebSocket] Seconds until next reconnect attempt: 32 cast_receiver.js:18 [ 76.675s] [goog.net.WebSocket] Opening the WebSocket on ws://localhost:8008/v2/ipc cast_receiver.js:18 [ 78.679s] [goog.net.WebSocket] An error occurred: undefined cast_receiver.js:18 [ 78.680s] [cast.receiver.IpcChannel] IpcChannel error cast_receiver.js:18 [ 78.680s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message cast_receiver.js:18 [ 78.680s] [goog.net.WebSocket] The WebSocket on ws://localhost:8008/v2/ipc closed. cast_receiver.js:18 [ 78.681s] [cast.receiver.IpcChannel] IpcChannel closed cast_receiver.js:18 [ 78.681s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message cast_receiver.js:18 [ 78.681s] [goog.net.WebSocket] The WebSocket disconnected unexpectedly: undefined cast_receiver.js:18 [ 78.681s] [goog.net.WebSocket] Seconds until next reconnect attempt: 60 cast_receiver.js:18 are there any idea? i am looking forward to your reply. thanks.
Sometimes, cannot access port 9222 even inputed correct serial number, after reboot from chromecast desktop app. To make sure reboot device, i got to reboot by reconnect chromecast manually.