I'm using iOS Chromecast app, from iPhone simulator, when I try to cast video (say, Big Buck Bunny), sample video starts almost instantly. However when I host (using godaddy.com ost service) the same video/mp4 (Bigbuckbunny.mp4) using same JSON file (videos-enhanced-b.json) from source http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ its takes about 2 minutes to render? Any explanations are greatly appreciated. Thanks
My media.h as below:
#import <Foundation/Foundation.h>
#define MEDIA_URL_BASE #"http://www.myhosturl.com/subdirectory/"
#define MEDIA_URL_FILE #"videos-enhanced-b.json"
I suggest you open a browser and point to port 9222 on your receiver and watch as the messages come in to see what is causing the delay. The sender app sends the load message directly to your receiver, so that is obviously very fast (and that wouldn't care if your media is here or there) but after that, the receiver has to go fetch the movie from your site and render that. Watch the log to see if you notice anything unusual there. Also, from your wifi network and on your laptop, try to do download the movie (point your browser to it, for example) and see how that performs.
Based on the log I got from the X-Code its takes about 3 minutes after "Media control channel metadata changed" as highlighted below.
2014-02-17 00:08:45.337 YouCast[1510:a0b] -[GCKMediaControlChannel didReceiveTextMessage:] message received: {"type":"MEDIA_STATUS","status":[{"mediaSessionId":1,"playbackRate":1,"playerState":"PAUSED","currentTime":0,"supportedMediaCommands":15,"volume":{"level":1,"muted":false},"media":{"contentId":"http://myurl.com/dd1.mp4","streamType":"NONE","duration":40.77424,"contentType":"video/mp4","metadata":{"title":"Elephant Dream","images":[{"url":"http://myurl.com/images_480x270/ElephantsDream.jpg","width":200,"height":100}],"metadataType":0,"subtitle":"Blender Foundation"}}}],"requestId":3}
2014-02-17 00**:08:45.338** YouCast[1510:a0b] Media control channel status changed
**2014-02-17 0**0:08:45.34**0 YouCast[1510:a0b] Media control channel metadata changed
2014-02-17 00:08:48.617 YouCast[1510:a0b] -[GCKCastSocket socket:didReadData:withTag:] prefix read, expected message length=248**
2014-02-17 00:08:48.618 YouCast[1510:a0b] -[GCKMediaControlChannel didReceiveTextMessage:] message received: {"type":"MEDIA_STATUS","status":[{"mediaSessionId":1,"playbackRate":1,"playerState":"PLAYING","currentTime":1.291666,"supportedMediaCommands":15,"volume":{"level":1,"muted":false}}],"requestId":0}
Note:not able to point chrome browser to 9222
Related
I am trying to cast videos from my html video player to TV via chromecast.
Sender: CastVideos-chrome
https://github.com/googlecast/CastVideos-chrome
Receiver: CastReferencePlayer (registered as a Custom receiver, hosted on my github,
https://github.com/PhilSSOO/052617_CastReferencePlayer
and the app ID was input to the sender's CastVideos.js file)
The whole sender folder was put to my server applied from Apache. The path is
C:\Apache24\htdocs\CastVideos-chrome
Putting http//localhost/CastVideos-chrome/ to the address bar of the chrome browser and hit Enter, the app is up and running with videos being cast to TV. Now, my question is: How can I know my custom receiver is functioning? I tried to do some modifications on my css file (receiver app consists of player.html, player.js, player.css) but nothing seemed to be changing on my TV screen.
Please help!
Here's what the Custom Receiver Application has to say:
Note: Google Cast receiver applications must be hosted on secure
servers supporting https when published. Publishing a Google Cast
receiver application may take several hours to propagate to all Google
Cast devices (up to 6 hours). If you wish to verify that your
published application is working properly, you can manually restart
your Google Cast device to force a load of new configuration data.
Check the docs for more details about Application Configuration.
noogui,
Thank you for your reply.
I purposely modified the CSS file of my custom receiver (styled the progressBar with green color --- rgb(48, 249, 55) --- ), hosted it on my github account, published the receiver, waited 6 h and started testing. Upon starting my sender app the video got cast to TV, and the progressBar is still yellow, NOT GREEN. This means my receiver is not functioning!
I also tried a style receiver, and even styled the progressBar with a wrong color (rgb(48, 249, $$$)). The sender app also cast the video to TV without any complaint. The conclusion is, my receiver is not being called!
I tried to use the Chrome Remote Debugger to debug, but my chromecast device, although showed up on my laptop, didn't have the inspect link with it, so I couldn't go further.
BTW, my sender works fine with default receiver.
I got lost!
Thanks!
I figured that out. The issue was related to app hosting.
When a custom receiver is registered to google cast console, the receiver hosting URL and associated sender hosting URL are not where they are stored, but where they are published. For example, the receiver hosting URL
https://github.com/USER/REPOSITORYNAME
is not to be used, but the following URL is
https://USER.github.io/REPOSITORYNAME......
(this can be accessed via Settings --- GitHub Pages)
Once the correct URL is used, my custom receiver is up and running!
Cheers!
We have successfully launched with chromecast support on our app and it was perfectly working fine, from the past few days it suddenly stopped working(the receiver was alway sending the buffering status to sender and it was continuously buffering), i have used the chrome debugging and able to find this exception in console
"Uncaught NotSupportedError: Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('video/mp2t; codecs="mp4a.40.2,avc1.77.31"') is unsupported." in the media_player.js file (on the 80th line - according to chrome debugger).
not able to understand why suddenly this error is thrown, all our customers started complaining that chromecast support is not working.
can you please guide me through the problem.
Note: I have used the custom receiver sample from google cast github and modified the styling.
we are using HLS for streaming videos:
here is the sample m3u8 file content:
#EXTM3U
#EXT-X-VERSION:1
## Created with Unified Streaming Platform(version=1.6.9)
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=323376,CODECS="mp4a.40.2,avc1.77.31",RESOLUTION=1024x576
707eb5bd-dcdf-4f84-b1a3-7cdbd0d4af89-audio=131072-video_eng=174000.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=510996,CODECS="mp4a.40.2,avc1.77.31",RESOLUTION=1024x576
707eb5bd-dcdf-4f84-b1a3-7cdbd0d4af89-audio=131072-video_eng=351000.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=722996,CODECS="mp4a.40.2,avc1.77.31",RESOLUTION=1024x576
707eb5bd-dcdf-4f84-b1a3-7cdbd0d4af89-audio=131072-video_eng=551000.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1078096,CODECS="mp4a.40.2,avc1.77.31",RESOLUTION=1024x576
707eb5bd-dcdf-4f84-b1a3-7cdbd0d4af89-audio=131072-video_eng=886000.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1415176,CODECS="mp4a.40.2,avc1.77.31",RESOLUTION=1024x576
707eb5bd-dcdf-4f84-b1a3-7cdbd0d4af89-audio=131072-video_eng=1204000.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1743776,CODECS="mp4a.40.2,avc1.77.31",RESOLUTION=1024x576
707eb5bd-dcdf-4f84-b1a3-7cdbd0d4af89-audio=131072-video_eng=1514000.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2068136,CODECS="mp4a.40.2,avc1.77.31",RESOLUTION=1024x576
707eb5bd-dcdf-4f84-b1a3-7cdbd0d4af89-audio=131072-video_eng=1820000.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2498496,CODECS="mp4a.40.2,avc1.77.31",RESOLUTION=1024x576
707eb5bd-dcdf-4f84-b1a3-7cdbd0d4af89-audio=131072-video_eng=2226000.m3u8
I did saw answer to this post:
Is avc1.66.31,mp4a.40.2 supported by the Chromecast device?
but as we have different version of avc codec - avc1.77.31 don't know, what's the best way to get it working.
Note: I have posted the same question on G+ community, will update the answer there if i find a working solution here. thanks.
Try replacing your codec with avc1.77.30
host.processManifest = function(manifest) {
return manifest.replace(/CODECS=\"avc1.77.([0-9]*)/g, 'CODECS=\"avc1.77.30');
};
I have problem with launching Google-Cast application similar to sample CastHelloText-chrome. I slightly modified example code for my specific purposes. The goal for creating this application is to send and show image data directly in Chromecast device.
Particularly the difference between official sample and my code is in message format and its content, sent by sender application. Sender application took png image coded by base64 and send through message bus with custom namespace. Receiver application get this message and use this as data source for html object <img>.
Error appears when I do this steps:
Reload sender page, checking console if any device found.
Send the form by just pushing enter on input box (text is ignored).
Now a popup from Chromecast extension shows. Next there are two scenarios:
3a) I confirm casting to device by choosing one from the list, then I get this error message in console:
onError: {"code":"channel_error","description":"Error: Timeout","details":null}
3b) I just click somewhere else, I get this error:
onError: {"code":"cancel","description":"User closed popup menu","details":null}
Both of errors are caused by calling function chrome.cast.requestSession in chromehellotext.html at line 161, but what's really wrong I don't know.
When I step sender script I realize that function sessionListener is never called. I know that something go wrong when code try to call chrome.cast.requestSession, where described error raises. So I need help if I missed about right way to use Google-Cast API or If this problem has something to do with networking issues.
Receiver application is registered on Google Cast SDK Developer Console and I'm testing on registered device with some serial number. I'm using Google Chrome in version 42.0.2300.2 canary (64-bit) and Chrome version 40.0.2214.111 (current stable I suppose). For testing I also tried to turn off Windows Firewall entirely but with no luck.
Edit:
There were some syntactic errors that caused error message described above.
It seems like you are trying to use the data/control channel to send an image; please don't do that; that channel is not meant to be used for large data communications; in fact it cannot send anything which approaches or exceeds 64k. If your goal is to send images from your local machine, you would need to run a local web server on your local machine and serve images through the web server.
For and easiest tutorial you can have a look to this tutorial.
It is well explained in this tutorial.
Chromecast Sender application
There is no need to maintain session by yourself.
just add button and enjoy casting
mCastManager.addMediaRouterButton(mediaRoutebtn);
I found a source of my problem. There was something wrong in receiver code - syntactic and runtime errors, so I must admit that my code wasn't functional. Now its working in terms of launching application and getting session.
Unfortunate thing is that the error message generated by Chromecast extension didn't match the actual error - at least it was a bit confusing when I didn't know what's really happening on receiver side without ability to debug the code.
I can't get a basic sender app set up. I've tried the CastHelloText sender example, put in my own AppId and get an error immediately after chrome.cast.requestSession() is called when I select my device from the top-right Google Cast extension button. My receiver is based off of Cast-Simple-Receiver. I've done the whole unplugging power/plugging back in thing to restart ChromeCast, but that doesn't resolve my issue.
Resources out there seem kind of slim at the moment, but is there a place that explains everything in-depth without having to jump from site to site? Also, take a look at the image I've attached. I can't figure out what that other URL is supposed to be.
My specific error from the requestSession() looks like this:
{code: "session_error", description: "NOT_FOUND", details: null}
EDIT: I've verified that I can connect to the default chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID but my receiver app can't be connected to. I've registered my device and restarted it multiple times. I've now removed it and am trying to re-register it to see if that helps (even though it said it was ready for dev).
Check these; hopefully they get things sorted out:
Make sure you have registered your chromecast device on the developer console. Double check the serial number since sometimes it is hard to read it.
During the chromecast setup, there was a box stating something like "Send the serial number ..", make sure that is checked
Wait 1/2 hour or so and reboot your chromecast
Check whether you can access http://<chromecast-ip>:9222 from a chrome browser on the same wifi network; if you can, then your device is ready for development
As for the area on the image that you have pointed to, that is more for informational purposes at this point
I have a program that asynchronously downloads 4 files into the Documents folder of an ipad, and this works perfectly on the simulator, but when I use it on an actual ipad it gives me this error:
Error Domain=ASIHTTPRequestErrorDomain Code=2 "The request timed out" UserInfo=0x1c0810 {NSLocalizedDescription=The request timed out}
Is there any way to fix this, or extend the time until time out?
The reason why you are getting better results in the simulator is probably because the simulator uses the built in network card and your Mac's network card is likely stronger than the one in the iPad.
You can use the following code to change the timeout interval. This code will set the timeout to twenty seconds:
[request setTimeOutSeconds:20]
According to the ASIHTTPRequest "How to Use" page, you can tell ASIHTTPRequest to try again N times, like so:
[request setNumberOfTimesToRetryOnTimeout:2];
EDIT:
Although it's 2016 and ASIHTTPRequest is long since deprecated, there's another useful bit of information to help diagnose networking issues on iOS devices. Try using the Network Link Conditioner. It ships with iOS and can be downloaded on macOS.
This article (link) from NSHipster has some great information on getting set up.
Cause of this problem may be the following. When we send a httprequest and don't received response from server but at this time you send another httprequest again and with second request response is received before first request.