sarbagyastha / youtube_player_flutter

A Flutter plugin for inline playback or streaming of YouTube videos using the official iFrame Player API.
https://youtube.sarbagyastha.com.np
BSD 3-Clause "New" or "Revised" License
708 stars 821 forks source link

[BUG] [IOS] can't play a shorts video just uploaded to Youtube #698

Closed tascienes closed 2 years ago

tascienes commented 2 years ago

I can't play a some shorts video just uploaded to Youtube. However, after about 1 day, I can play the same video. What could be the reason for this?

NOTE : This problem only occurring in IOS.

I am using Youtube Player IFrame package. Version 3.0.4

Debug Info for video I tested { "ns": "yt", "el": "embedded", "cpn": "PZ-crpSCPX2EdmtE", "ver": 2, "cmt": "0", "fmt": "22", "fs": "0", "rt": "2.975", "euri": "https://www.youtube.com/", "lact": 1, "cl": "471102031", "mos": 0, "state": "444", "volume": 100, "cbrand": "apple", "cbr": "Webview", "c": "WEB_EMBEDDED_PLAYER", "cver": "1.20220830.01.00", "cplayer": "UNIPLAYER", "cmodel": "iphone", "cos": "iPhone", "cosver": "15_5", "cplatform": "MOBILE", "epm": 1, "hl": "en_US", "cr": "TR", "len": "60", "fexp": "23848210,23983296,24001373,24002022,24002025,24004644,24007246,24080738,24135310,24169501,24197276,24226335,24232295,24248385,24255165,24260441,24269951,24269957,24271464,24276618", "size": "343:610:2", "muted": "0", "docid": "5JMq8wcxF2E", "ei": "6XUQY42hH7yAx_APhKWrqAw", "plid": "AAXnmeszG14rtCJl", "referrer": "https://www.youtube.com/embed/?autoplay=1&mute=0&cc_lang_pref=en&cc_load_policy=1&color=white&controls=1&disablekb=1&enablejsapi=1&fs=0&hl=en&iv_load_policy=1&loop=0&modestbranding=1&origin=https%3A%2F%2Fwww.youtube.com&playsinline=1&rel=0&start=0&widgetid=1", "of": "MMHlix5PUWE_NS3DUul_AA", "vm": "CAEQABgEOjJBTlRLbG5zc2FvREdiRFBFQTNYZXRCT01JdUtkc2VPbDV5cVNIMHdET2EtaUJYRXZlQWJSQVBta0tESzJDVWxsN2pyckh2Y2x0ZUY3cjNIZmNSOGtkekZmVnRkLTFjVGJ4QndUZEh6UkZzREtBM3pyUHA1MmRrdllRM2RoY1dGd2dqeXk5QQ", "vct": "0.000", "vd": "NaN", "vpl": "", "vbu": "", "vpa": "0", "vsk": "0", "ven": "0", "vpr": "1", "vrs": "0", "vns": "3", "vec": "4", "vemsg": "Unsupported source type", "vvol": "1", "vdom": "1", "vsrc": "1", "vw": "343", "vh": "610", "ismb": 9410000, "relative_loudness": "-5.590", "optimal_format": "360p", "user_qual": 0, "release_version": "youtube.player.web_20220830_01_RC00", "debug_videoId": "5JMq8wcxF2E", "0sz": "false", "op": "", "yof": "true", "dis": "", "gpu": "Apple_GPU", "debug_playbackQuality": "medium", "debug_date": "Thu Sep 01 2022 12:05:48 GMT+0300 (+03)" }

glosama commented 2 years ago

Are you playing a short video with this package? If you can share the code.

tascienes commented 2 years ago

Are you playing a short video with this package? If you can share the code.

Yes, short video. But I noticed this; We try to upload a video every day at 6 o'clock and show that video in the application. But the video cannot be played in the app and website for 'apple' mobile devices within the first 3-4 hours of loading. Maybe it is due to IOS.

I will test it as a webview when we upload the next video.

YoutubePlayerControllerProvider( controller: controller.ytController, child: YoutubePlayer( aspectRatio: 9 / 16, enableFullScreenOnVerticalDrag: false, controller: controller.ytController, ), ),

ytController = YoutubePlayerController( params: YoutubePlayerParams( showFullscreenButton: false, ), ) ..onInit = () async { await ytController.cueVideoByUrl( mediaContentUrl: youtubeURL, startSeconds: 0, ); } ..listen((event) { if (ytController.value.playerState == PlayerState.ended) { ytController.cueVideoByUrl(mediaContentUrl: youtubeURL); } });