ponnamkarthik / FlutterYoutube

Flutter Plugin to play youtube Videos
Apache License 2.0
126 stars 56 forks source link

Video not works in iOS #40

Closed PiN73 closed 5 years ago

PiN73 commented 5 years ago

I'm trying to play video

FlutterYoutube.playYoutubeVideoById(
  apiKey: <my api key>,
  videoId: 'CLXt3yh2g0s',
);

Android works well, but in iOS it closes player after a second. Here are logs

[XCDYouTubeKit] Video operation finished with error: This video is unavailable.
Domain: XCDYouTubeVideoErrorDomain
Code:   150
User Info: {
    AllowedCountries = "{(\n    Hungary,\n    Vietnam,\n    \"New Caledonia\",\n    Burundi,\n    Andorra,\n    \"Pitcairn Islands\",\n    Guinea,\n    \"Norfolk Island\",\n    Togo,\n    Eritrea,\n    Zambia,\n    Syria,\n    Mongolia,\n    Thailand,\n    Netherlands,\n    \"French Guiana\",\n    India,\n    Sudan,\n    Nicaragua,\n    Tanzania,\n    Algeria,\n    Grenada,\n    Venezuela,\n    \"Dominican Republic\",\n    Turkey,\n    \"New Zealand\",\n    Serbia,\n    Japan,\n    Monaco,\n    Finland,\n    Paraguay,\n    Lithuania,\n    Suriname,\n    Dominica,\n    Mauritania,\n    Armenia,\n    Panama,\n    \"St. Martin\",\n    Guernsey,\n    Cambodia,\n    \"Western Sahara\",\n    Azerbaijan,\n    Gabon,\n    Macedonia,\n    Tonga,\n    Bhutan,\n    Lebanon,\n    \"Hong Kong\",\n    \"Svalbard & Jan Mayen\",\n    \"Falkland Islands\",\n    Montserrat,\n    \"Cura\\U00e7ao\"<…>
    [C1.1 B3A3DAF3-0D30-499D-8D39-04D938C4C582 10.0.0.9:59352<->74.125.131.198:443]
    Connected Path: satisfied (Path is satisfied), interface: en0
    Duration: 2.199s, DNS @0.003s took 0.060s, TCP @0.071s took 0.040s, TLS took 0.152s
    bytes in/out: 473777/1301, packets in/out: 366/16, rtt: 0.055s, retransmitted packets: 0, out-of-order packets: 0
PiN73 commented 5 years ago

It turned out that the error occurs if the video embedding is restricted.

When I replace video with one that is not restricted for embedding, say, this, the error goes away