android - Cast image (photo) to Chromecast -


i'm following these (1, 2) guides create sender android application chromecast , i'm interested in sending pictures. there lot of informaton , samples how cast text, audio , video. not single word how pictures.

i belive in power of stackoferflow , should've faced such problem. please give sample or tutorial. need guide cast fullscreen picture using media router , features.

thats how sending text message using custom channel:

 /**  * send text message receiver  */ private void sendmessage(string message) {     if (mapiclient != null && msmartbuschannel != null) {         try {             cast.castapi.sendmessage(mapiclient,                     msmartbuschannel.getnamespace(), message)                     .setresultcallback(new resultcallback<status>() {                         @override                         public void onresult(status result) {                             if (!result.issuccess()) {                                 log.e(tag, "sending message failed");                             }                         }                     });         } catch (exception e) {             log.e(tag, "exception while sending message", e);         }     } else {         toast.maketext(this, message, toast.length_short)                 .show();     } } 

video sending using remoteplaybackclient.. okay, what's pictures?

much help.


edit:

i have found out method (on blog) of how possible send pictures local storage. , yeah, doesn't seem working.

public final void openphotoonchromecast(string title, string url, string ownername, string description) {     try {         log.d(tag, "openphotoonchromecast: " + url);         jsonobject payload = new jsonobject();         payload.put(key_command, "viewphoto");         payload.put("fullsizeurl", url);         payload.put("ownername", ownername);         payload.put("title", title);         payload.put("description", description);          sendmessage(payload);     } catch (jsonexception e) {         log.e(tag, "cannot parse or serialize data openphotoonchromecast", e);     } catch (ioexception e) {         log.e(tag, "unable send openphotoonchromecast message", e);     } catch (illegalstateexception e) {         log.e(tag, "message stream not attached", e);     } } 

p.s. method uses sendmessage(...) these libraries (from gradle):

compile files('libs/commons-io-2.4.jar') compile files('libs/googlecastsdkandroid.jar') 

looking here: examples using castcompanionlibrary display image there 3 options sending images chromecast.

  1. you can encode image in base64 string , send on data channel receiver. if big, can split , send across in multiple messages. poor use of cast technology , shouldn't this, possible.
  2. you send url chromecast device , grab sever inside receiver app. the recommended way send photos across chromecast
  3. if aren't downloading images server set own server running inside client android app , send url receiver grab there. rather complicated sending images across, far more robust option option 1.

the goal of chromecast, according google, stream content cloud, why there isn't native support sending local images. developers should encouraged load images on receiver application server.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -