Casty icon indicating copy to clipboard operation
Casty copied to clipboard

How to Cast Youtube Video using Casty?

Open SopMar opened this issue 8 years ago • 2 comments

I found Casty during my search, I have a question, what If I would like to cast Youtube Video using Casty lib.

Here is the link of sample code, I am using to play Youtube video using API within my App... I want to cast same.

I believe it's not gonna take much time for you, so can you please write a separate method to cast Youtube Video in your MainActivity.java class. (I'm afraid, in this case we have Play/Pause already :) )

Can we use something like this, to work with Youtube videos: return new MediaData.Builder("https://www.youtube.com/watch?v=RKjUPQCXnsM")

Shall we need to keep other variables same as you kept in createSampleMediaData() method and what are the areas where we need to make changes in our code... (in existing class)

SopMar avatar Aug 10 '17 17:08 SopMar

To play Youtube video in Casty (or Google Cast v3), you will need a direct video URL - so you have to use another YouTube API -> Data API

burnoo avatar Aug 14 '17 11:08 burnoo

I've asked, check this Stackoverflow link - https://stackoverflow.com/questions/45684260/cast-video-to-tv-using-mediaroutebutton

Assume I am already familiar with YouTube API... and I have YouTube Video URL too, like this one: https://www.youtube.com/watch?v=RKjUPQCXnsM

So my main concern is. Is it possible to cast YouTube Video... if yes so do we really require play / pause button separately to play and stop video like we are doing in existing case, and is the way our youtube video url should look like:

return new MediaData.Builder("https://www.youtube.com/watch?v=RKjUPQCXnsM")

Actually, I don't have things required to test casting like Chromecast... that's why I can't test at my end... But I shared what I am assuming... can you confirm it once...

SopMar avatar Aug 14 '17 21:08 SopMar