title: Open Chromecast youtube video from android application
body: <p>I created an app in which there is a list view with youtube links. Now I want to play these videos using chrome cast. I followed the official documentation and I am able to play other videos with direct mp4 link, but its not working for youtube links. </p>
  
  <p>Of course the other links are directly connected to a video (ending *.mp4), but how can i add a media with a youtube link? Somehow I need to create a MediaInfo object with youtube link, but I don't know how to do that or is it even possible.</p>
  
  <p>I have found this information</p>
  
  <p>MimeData data = new MimeData("v=g1LsT1PVjUA", MimeData.TYPE_TEXT);
  mSession.startSession("YouTube", data);</p>
  
  <p><a href="https://stackoverflow.com/questions/18115563/open-chromecast-youtube-video-from-my-android-app[/URL]">Open Chromecast YouTube video from my Android app</a></p>
  
  <p>But I am not sure how to get the session and load it with youtube session. I would appreciate if someone can help me with this.</p>
  
  <p>Thanks for your help</p>