Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

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;
    }
    }