chromecast debugger works, but does not show anything?

…衆ロ難τιáo~ 提交于 2021-02-06 13:55:24

问题


I recently installed a chrome-cast device and enabled the debugger mode on that device. Send the receiver aplication to google and got the application id back from them.

Set the application id into my sender application and everything works great. But the problem is I can not see anything on the debugger and can not debug my code online.

the http: // chrome-cast-ip:9222/ is working and shows me the debugger link

https: // chrome-devtools-frontend.appspot.com/serve_rev/@185691/inspector.html?ws=.....

So there is no issue on my device or activating the debugging mode.

I also have set the debugging level into my receiver application

            cast.receiver.logger.setLevelValue(cast.receiver.LoggerLevel.DEBUG);

however this is still not working and does not show anything to me.

http://i.stack.imgur.com/G2WJD.png

        <script type="text/javascript">
        window.onload = function() {

            cast.receiver.logger.setLevelValue(cast.receiver.LoggerLevel.DEBUG);
            //window.location.reload(true);
            console.log('Starting Receiver Manager');

            debugger; 


            window.castReceiverManager = cast.receiver.CastReceiverManager.getInstance();

            // handler for the 'ready' event
            castReceiverManager.onReady = function(event) {
                console.log('Received Ready event: ' + JSON.stringify(event.data));
                window.castReceiverManager.setApplicationState("Application status is ready...");
            };
            //debugger;
            // handler for 'senderconnected' event
            castReceiverManager.onSenderConnected = function(event) {
                console.log('Received Sender Connected event: ' + event.data);
                console.log(window.castReceiverManager.getSender(event.data).userAgent);
            };

            // handler for 'senderdisconnected' event
            castReceiverManager.onSenderDisconnected = function(event) {
                console.log('Received Sender Disconnected event: ' + event.data);
                if (window.castReceiverManager.getSenders().length == 0) {
                    window.close();
                }
            };

            // handler for 'systemvolumechanged' event
            castReceiverManager.onSystemVolumeChanged = function(event) {
                console.log('Received System Volume Changed event: ' + event.data['level'] + ' ' +
                event.data['muted']);
            };

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

            // handler for the CastMessageBus message event
            window.messageBus.onMessage = function(event) {
                console.log('Message [' + event.senderId + ']: ' + event.data);
                // display the message from the sender
                displayText(event.data);

                // inform all senders on the CastMessageBus of the incoming message event
                // sender message listener will be invoked
                window.messageBus.send(event.senderId, event.data);
            }

            // initialize the CastReceiverManager with an application status message
            window.castReceiverManager.start({statusText: "Application is starting"});
            console.log('Receiver Manager started');

        };

回答1:


Did you click on the shield icon next to the star in the url box? Do that and accept the content from unsafe source and that should make it work for you.



来源:https://stackoverflow.com/questions/28629844/chromecast-debugger-works-but-does-not-show-anything

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!