0

I have passed the same url in GCKMediaMetadata object and GCKMediaInformation object contentID is correct?? I don't know which URL i pass in contentId of GCKMediaInformation please help me I am a beginner in chromecast SDK. Thanks in Advance.

-(void)startCasting {

GCKMediaMetadata *metadata = [[GCKMediaMetadata alloc] init];
[metadata addImage:[[GCKImage alloc]
                    initWithURL:[NSURL URLWithString:@"https://fbcdn-photos-a-a.akamaihd.net/hphotos-ak-prn2/v/t1.0-0/s180x540/10444708_650079241771730_1270013251658544114_n.jpg?oh=f412367bc9632ed21aaf22bd7c08e3b2&oe=57FE0E19&__gda__=1476770561_aebfdf5d8dc13141e31a5848d8551cdb"]
                    width:480
                    height:360]];

GCKMediaInformation *mediaInformation =
[[GCKMediaInformation alloc] initWithContentID:@"https://fbcdn-photos-a-a.akamaihd.net/hphotos-ak-prn2/v/t1.0-0/s180x540/10444708_650079241771730_1270013251658544114_n.jpg?oh=f412367bc9632ed21aaf22bd7c08e3b2&oe=57FE0E19&__gda__=1476770561_aebfdf5d8dc13141e31a5848d8551cdb"
                                    streamType:GCKMediaStreamTypeNone
                                   contentType:@"image/jpeg"
                                      metadata:metadata
                                streamDuration:0
                                    customData:nil];
[_mediaControlChannel loadMedia:mediaInformation autoplay:YES playPosition:0];

}

GMchris
  • 5,439
  • 4
  • 22
  • 40

1 Answers1

2

For chromecast to work as intended, you need to have a web server that is hosting/serving your image and use the URL that the web server provides there. If your images are somewhere in the cloud, that should be trivial; if images are on your phone, then you need to embed a local web server in your phone sender app and use that to serve the images and pass the URL based on what your web server provides.

Ali Naddaf
  • 16,951
  • 2
  • 21
  • 28
  • I have fetched image from the Facebook and want to display on the TV using custom receiver.Facebook image url is already there so no need to host the image right or not?? – Nishat Alam Jul 04 '16 at 03:51
  • how to send the image to the custom receiver iOS Ali can you please give me any idea.For any reply thanks – Nishat Alam Jul 04 '16 at 12:16
  • Receiver does not depend on whether you are using iOS or Android or chrome sender. I suggest you use the Default or a Styled receiver instead of a custom one to make narrow down where your problem is. – Ali Naddaf Jul 04 '16 at 14:42
  • So, i am using custom receiver because my app allows a slide show image on the TV.I am very trouble to make receiver for display the image because not any receiver example of image in google cast developer.Can u give me idea where is the Custom Receiver.html sample of Google Cast site.I make a receiver (http://photo-genie.com/photogenie.html) but i am not sure this receiver is working or not.What i missed in Receiver please help me Ali Thanks in Advance. – Nishat Alam Jul 05 '16 at 04:04
  • my image url is https://fbcdn-photos-a-a.akamaihd.net/hphotos-ak-prn2/v/t1.0-0/s180x540/10444708_650079241771730_1270013251658544114_n.jpg?oh=f412367bc9632ed21aaf22bd7c08e3b2&oe=57FE0E19&__gda__=1476770561_aebfdf5d8dc13141e31a5848d8551cdb – Nishat Alam Jul 05 '16 at 10:34
  • fetching from the facebook and want to display the same url image on the TV. – Nishat Alam Jul 05 '16 at 10:35
  • First, try to use the Default Receiver to make sure you can show at least one image and then you can work on your own receiver. In addition, if I recall correctly, the content id is just the url with no "query" parameters; receiver will ignore those so the token that you have is not going to work for you. Again, I suggest first make it work with a publicly available image and once that worked, move to more complicated case. – Ali Naddaf Jul 05 '16 at 19:47
  • Default Receiver is working fine to display the one image but i want to use custom receiver because my app allows slide show image on the TV. Can i use Styled Media Receiver for display the slide show image ALI.Thanks for any help. – Nishat Alam Jul 06 '16 at 03:55
  • You can't. Please stop creating a new post for each related question that you have. – Ali Naddaf Jul 06 '16 at 08:09