ja2375 / FluTube

A Flutter plugin to facilitate embedding Youtube videos inside mobile apps.
MIT License
34 stars 17 forks source link

play called on null #17

Open logemann opened 4 years ago

logemann commented 4 years ago

I am geting this when try running the example:

The method 'play' was called on null. Receiver: null Tried calling: play()

logemann commented 4 years ago

after digging some more. Here is the debug screenshot. There is an issue in _fetchVideoURL().

parseAll = _allStringMatches(urls[1], RegExp("([^&,]*)[&,]"));

fails with the URL:

https%3A%2F%2Fr5---sn-4g5ednz7.googlevideo.com%2Fvideoplayback%3Fexpire%3D1572647605%26ei%3DVV68XdODCoHVgQfNrabYCA%26ip%3D87.171.73.133%26id%3Do-ABUrs8s4iKF-Afhtr2yiN4LGpTEm1Qpmp3oxcmMVuMfz%26itag%3D18%26source%3Dyoutube%26requiressl%3Dyes%26mm%3D31%252C29%26mn%3Dsn-4g5ednz7%252Csn-4g5e6nl7%26ms%3Dau%252Crdu%26mv%3Dm%26mvi%3D4%26pl%3D26%26initcwndbps%3D1150000%26mime%3Dvideo%252Fmp4%26gir%3Dyes%26clen%3D34221542%26ratebypass%3Dyes%26dur%3D569.051%26lmt%3D1540767188318662%26mt%3D1572625956%26fvip%3D6%26fexp%3D23842630%26c%3DWEB%26txp%3D5531432%26sparams%3Dexpire%252Cei%252Cip%252Cid%252Citag%252Csource%252Crequiressl%252Cmime%252Cgir%252Cclen%252Cratebypass%252Cdur%252Clmt%26sig%3DALgxI2wwRAIgA-rdN8L1gxIW4wB-PDtkbhoaANjacsACMkhfkUVTCDUCIFDT7Bt_IHxM6DrDUFnGFvDAAzroqiyLzpoV4lrZFS%26lsparams%3Dmm%252Cmn%252Cms%252Cmv%252Cmvi%252Cpl%252Cinitcwndbps%26lsig%3DAHylml4wRAIgHnmd42bT6NwsqiWf-qr-N0nFpQ_LanF1jjBJvp_01-MCIA25W6oH11kOs5KEDg-s0wwiPcWCHU7lFVeACWqnwH0O\u0026quality=medium\u0026itag=18\u0026type=video%2Fmp4%3B+codecs%3D%22avc1.42001E%2C+mp4a.40.2%22"

And thus videoController is not getting initialized and then play is called on null. There should be an error way before hitting the play button.

My Playlist is:

  final List<String> playlist = <String>[
    'https://www.youtube.com/watch?v=xLNeZogTsK8',
  ];
gsabanti commented 4 years ago

I experience the same problem. Seems to me that YouTube changed something so it affected everyone who tries to download their videos. Check this for example https://github.com/kkdai/youtube/issues/14

gsabanti commented 4 years ago

https://github.com/ja2375/FluTube/issues/22#issuecomment-568295302

DSenanayake commented 4 years ago

I've got the same issue.

I get this before the error. E/flutter (16585): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: RangeError (index): Invalid value: Valid value range is empty: 0

then,

The method 'play' was called on null. I/flutter (16585): Receiver: null I/flutter (16585): Tried calling: play()

kashlo commented 4 years ago

same error here