Search Unity

Video 1080p in youtube on android

Discussion in 'Audio & Video' started by knurgb, Jun 24, 2017.

  1. knurgb

    knurgb

    Joined:
    Jun 24, 2017
    Posts:
    8
    Hi,
    Is this possible to play 1080 or higher form YouTube on Android?

    I have a project with following code. I debug it and it does not enumerate by anything higher then 720. I tested it on PC and there are all resolutions. But I tested same video on youtube directly and I can see it has 1080 or higher resolution.

    Is there any way to play 1080 or higher in unity app on android?

    Thanks

    videoURL = YoutubeVideo.Instance.RequestVideo (youtubeVideoURL, 720);

    IEnumerable<VideoInfo> videoInfos = DownloadUrlResolver.GetDownloadUrls(urlOrId, false);
    VideoInfo video = null;

    //Search for video with desired format and desired resolution, you can filter if your own methods if you need.
    var enumerator = videoInfos.GetEnumerator();
    while (enumerator.MoveNext())
    {
    if (enumerator.Current.VideoType == VideoType.Mp4 && enumerator.Current.Resolution == quality)
    {
    video = enumerator.Current;
    break;
    }
    }