abdelaziz-mahdy / flutter_meedu_videoplayer

Cross-Platform Video Player for flutter
https://abdelaziz-mahdy.github.io/flutter_meedu_videoplayer/
MIT License
132 stars 69 forks source link

the youtube sample does not work on windows desktop for any url #171

Open floyd-lewis opened 10 months ago

floyd-lewis commented 10 months ago

Used the code from git repository. I entered https://www.youtube.com/watch?v=pRReSpMSYi4 as the youtube url. I am using Windows 10 Below is the stack trace.

[flutter_meedu_videoplayer] Exception: No Stream for textureId: -1. [flutter_meedu_videoplayer] #0 MdkVideoPlayer.videoEventsFor video_player_mdk.dart:208

1 VideoPlayerController.initialize

video_player.dart:488

#2 MeeduPlayerController.setDataSource controller.dart:533 #3 _YoutubeExamplePageState._setDataSource yotube_page_example.dart:123 [flutter_meedu_videoplayer] Fit is BoxFit.contain
floyd-lewis commented 10 months ago

I need to also mention that I had take the latest from git. The earlier release too would give a 403 access denied for url https://rr1---sn-cnoa-3aie.googlevideo.com/videoplayback?expire=1692960906&ei=KjToZOXWDLejrtoPuO-ayAI&ip=59.94.56.251&id=o-AE0UM5AHpSWOI0bl9WdO-rzhZF_mvouVT7rRpzbEXUFU&itag=18&source=youtube&requiressl=yes&mh=Fu&mm=31%2C29&mn=sn-cnoa-3aie%2Csn-cvh7knek&ms=au%2Crdu&mv=m&mvi=1&pcm2cms=yes&pl=21&initcwndbps=362500&spc=UWF9f_YJ0Fvd5HNud2YZR1KS-FuQD862IljhBctMQw&vprv=1&svpuc=1&mime=video%2Fmp4&gir=yes&clen=4003169&ratebypass=yes&dur=228.554&lmt=1676131464182282&mt=1692938945&fvip=2&fexp=24007246&beids=24350018&c=ANDROID&txp=5319224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRAIgYqOGrQ_3FoqeStHoOx2G-9jXDQ6EXdteCTu3MYy9z-sCICYVQpwPEq00zBaSJ5s-qZFhrQOTyE0a1Tkr2jk3ZnKh&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpcm2cms%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhAOM4fgm5YsgxZUpCOyPlxPinJQxSI1tW_eESzhdjz0rtAiEAgqme1PqOC0k9GkK1TNfyAAIF-CFLvAUp8hHFPJ7fWhc%3D

This happened for all the urls. I suspect the issue is identical but manifesting in a different waydue to changes to use FPV

abdelaziz-mahdy commented 10 months ago

Can you provide which example you were using? So I can provide explained steps to fvp?

Also I am going to test both examples of YouTube and your url

Keep in mind an error with 403 status code most probably an unauthorized, so make sure to attach http headers if needed

floyd-lewis commented 10 months ago

I was using the example which contains the Play Youtube video. And yes I can confirm my doubts. When I do flutter run --debug -windows from vscode terminal I get a detailed stack trace as below. What headers do I need to pass. Is there some instruction I am missing.

A Dart VM Service on Windows is available at: http://127.0.0.1:55651/LcDw0CfyGRs=/ The Flutter DevTools debugger and profiler on Windows is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:55651/LcDw0CfyGRs=/ flutter: https://rr1---sn-cnoa-3aie.googlevideo.com/videoplayback?expire=1692984611&ei=w5DoZLezIbb2juMP95uE2AI&ip=59.95.6.178&id=o-APRZwdpK1JctYB0bHm0ZSG5LnzlLxaIHQZ0ABq2qYgbG&itag=17&source=youtube&requiressl=yes&mh=bG&mm=31%2C29&mn=sn-cnoa-3aie%2Csn-cvh76nes&ms=au%2Crdu&mv=m&mvi=1&pl=22&initcwndbps=763750&spc=UWF9f4BCNCoVGPATsn5O1Kcf4IMNDF6yr6jLn7NhVw&vprv=1&svpuc=1&mime=video%2F3gpp&gir=yes&clen=32913909&dur=5355.775&lmt=1599571544101225&mt=1692962713&fvip=2&fexp=24007246%2C24363392&beids=24350017&c=ANDROID&txp=7211222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgKCkYIHXPBjhb15HCRSRG5NbaunlOjT0ZfrkQJdA9Q0YCIQDhlnTJIol4fX2JvYw9gk1Ccas5cC90xdJvPCNb0GT0cw%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgVeiXFo893vBMJ-Fa_EJT3bFy9Ox8C-5aV7gckBUjMfcCICnf94ua9HENNSXFdj52C8nyXZGwBxbCH0OiJZb2r2aU flutter: fvp.FINE: 2023-08-25 16:59:27.249095: 232830620 player2316695231424 create(https://rr1---sn-cnoa-3aie.googlevideo.com/videoplayback?expire=1692984611&ei=w5DoZLezIbb2juMP95uE2AI&ip=59.95.6.178&id=o-APRZwdpK1JctYB0bHm0ZSG5LnzlLxaIHQZ0ABq2qYgbG&itag=17&source=youtube&requiressl=yes&mh=bG&mm=31%2C29&mn=sn-cnoa-3aie%2Csn-cvh76nes&ms=au%2Crdu&mv=m&mvi=1&pl=22&initcwndbps=763750&spc=UWF9f4BCNCoVGPATsn5O1Kcf4IMNDF6yr6jLn7NhVw&vprv=1&svpuc=1&mime=video%2F3gpp&gir=yes&clen=32913909&dur=5355.775&lmt=1599571544101225&mt=1692962713&fvip=2&fexp=24007246%2C24363392&beids=24350017&c=ANDROID&txp=7211222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgKCkYIHXPBjhb15HCRSRG5NbaunlOjT0ZfrkQJdA9Q0YCIQDhlnTJIol4fX2JvYw9gk1Ccas5cC90xdJvPCNb0GT0cw%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgVeiXFo893vBMJ-Fa_EJT3bFy9Ox8C-5aV7gckBUjMfcCICnf94ua9HENNSXFdj52C8nyXZGwBxbCH0OiJZb2r2aU) flutter: mdk.INFO: 2023-08-25 16:59:27.305063: default0000021B5B1C2B60 new FrameReader... flutter: mdk.INFO: 2023-08-25 16:59:27.305063: Registered audio backends: XAudio2 DSound null flutter: mdk.INFO: 2023-08-25 16:59:27.305063: XAudio2_9.dll flutter: mdk.INFO: 2023-08-25 16:59:27.305063: Build with XAudio2 from Win8+ SDK flutter: mdk.INFO: 2023-08-25 16:59:27.305063: Try symbol 'XAudio2Create' from Windows SDK dll flutter: mdk.INFO: 2023-08-25 16:59:27.305063: default0000021B657E5B50 new FrameReader... flutter: mdk.INFO: 2023-08-25 16:59:27.306061: Registered audio backends: XAudio2 DSound null flutter: mdk.INFO: 2023-08-25 16:59:27.306061: 0000021B6591C770cdecl mdk::abi::Player::Player(void) flutter: mdk.INFO: 2023-08-25 16:59:27.306061: default FrameReader0000021B5B1C2B60 state: 0=>0=>0, 0 flutter: mdk.INFO: 2023-08-25 16:59:27.306061: default0000021B5B1C2B60 void cdecl mdk::abi::FrameReader::stop(void), current state: 0 flutter: mdk.INFO: 2023-08-25 16:59:27.306061: default FrameReader0000021B5B1C2B60 state: 0=>0=>0, 0 flutter: mdk.INFO: 2023-08-25 16:59:27.306061: default0000021B5B1C2B60 void cdecl mdk::abi::FrameReader::stop(void), current state: 0 flutter: mdk.INFO: 2023-08-25 16:59:27.306061: 0000021B658208C0 MediaControl.prepare(0, ...) https://rr1---sn-cnoa-3aie.googlevideo.com/videoplayback?expire=1692984611&ei=w5DoZLezIbb2juMP95uE2AI&ip=59.95.6.178&id=o-APRZwdpK1JctYB0bHm0ZSG5LnzlLxaIHQZ0ABq2qYgbG&itag=17&source=youtube&requiressl=yes&mh=bG&mm=31%2C29&mn=sn-cnoa-3aie%2Csn-cvh76nes&ms=au%2Crdu&mv=m&mvi=1&pl=22&initcwndbps=763750&spc=UWF9f4BCNCoVGPATsn5O1Kcf4IMNDF6yr6jLn7NhVw&vprv=1&svpuc=1&mime=video%2F3gpp&gir=yes&clen=32913909&dur=5355.775&lmt=1599571544101225&mt=1692962713&fvip=2&fexp=24007246%2C24363392&beids=24350017&c=ANDROID&txp=7211222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgKCkYIHXPBjhb15HCRSRG5NbaunlOjT0ZfrkQJdA9Q0YCIQDhlnTJIol4fX2JvYw9gk1Ccas5cC90xdJvPCNb0GT0cw%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgVeiXFo893vBMJ-Fa_EJT3bFy9Ox8C-5aV7gckBUjMfcCICnf94ua9HENNSXFdj52C8nyXZGwBxbCH0OiJZb2r2aU flutter: mdk.INFO: 2023-08-25 16:59:27.306061: default 0000021B5B1C2B60 FrameReader.start(0, ...) flutter: mdk.INFO: 2023-08-25 16:59:27.307060: default 0000021B5B1C2B60 FrameReader::update MediaStatus 0=>0X2flutter: fvp.FINE: 2023-08-25 16:59:27.311058: 232830620 player2316695231424 onMediaStatusChanged: MediaStatus(noMedia) => MediaStatus(+loading) flutter: mdk.INFO: 2023-08-25 16:59:27.313058: default FrameReader0000021B5B1C2B60 state: 0=>0=>1, 0 flutter: mdk.INFO: 2023-08-25 16:59:27.313058: default FrameReader0000021B5B1C2B60 state: 0=>1=>1, 0 flutter: mdk.INFO: 2023-08-25 16:59:27.314056: start frame reader thread: 1860 flutter: mdk.INFO: 2023-08-25 16:59:27.314056: try to load av module: F:\floyd\src\flutter\flutter_meedu_videoplayer\package\example\build\windows\runner\Debug\ffmpeg-6.dll flutter: mdk.INFO: 2023-08-25 16:59:27.314056: ffmpeg loaded: F:\floyd\src\flutter\flutter_meedu_videoplayer\package\example\build\windows\runner\Debug\ffmpeg-6.dll flutter: mdk.INFO: 2023-08-25 16:59:27.315060: Selected avutil runtime version: 58.17.100 (build: 58.17.100), license: LGPL version 2.1 or later flutter: mdk.INFO: 2023-08-25 16:59:27.315060: Selected avutil runtime configuration: --extra-version=avbuild --disable-doc --disable-debug --enable-shared --enable-runtime-cpudetect --enable-libvpl --disable-ptx-compression --enable-mediafoundation --disable-postproc --toolchain=msvc --windres=llvm-windres --extra-windresflags='--target=x86_64-pc-windows-msvc -I/c/Program\ Files/Microsoft\ Visual\ Studio/2022/Enterprise/VC/Tools/MSVC/14.35.32215/include -I/c/Program\ Files/Microsoft\ Visual\ Studio/2022/Enterprise/VC/Tools/MSVC/14.35.32215/ATLMFC/include -I/c/Program\ Files/Microsoft\ Visual\ Studio/2022/Enterprise/VC/Auxiliary/VS/include -I/c/Program\ Files\ (x86)/Windows\ Kits/10/include/10.0.22621.0/ucrt -I/c/Program\ Files\ (x86)/Windows\ Kits/10/include/10.0.22621.0/um -I/c/Program\ Files\ (x86)/Windows\ Kits/10/include/10.0.22621.0/shared -I/c/Program\ Files\ (x86)/Windows\ Kits/10/include/10.0.22621.0/winrt -I/c/Program\ Files\ (x86)/Windows\ Kits/10/include/10.0.22621.0/cppwinrt -I/c/Program\ Files\ (x86)/Windows\ Kits/NETFXSDK/4.8/include/um' --enable-pic --extra-cflags='-I/d/a/avbuild/avbuild/tools/Vulkan-Headers/include -MD -Zi -FS -guard:cf -I/d/a/avbuild/avbuild/tools/dep/include -D_WIN32_WINNT=0x0600' --extra-ldflags='-NODEFAULTLIB:libcmt -DEBUG -guard:cf -OPT:REF -SUBSYSTEM:CONSOLE' --enable-small --disable-outdevs --disable-filters --enable-filter='null,afade,fifo,format,resample,aeval,allrgb,allyuv,atempo,pan,bars,color,key,crop,draw,eq,framerate,_qsv,_vaapi,v4l2,hw,scale,volume,test' --disable-muxers --disable-encoders --disable-decoders --disable-demuxers --disable-filter=scale_cuda --enable-decoder='sub,movtext,web,aac,ac3,alac,ape,ass,av1,ccaption,cfhd,cook,dca,dnxhd,eac3,exr,truehd,ff,yuv,flv,flac,gif,h26[3-4],hevc,hap,mp[1-3],prores,peg,mlp,mpl2,nellymoser,opus,pcm,qtrle,png,tiff,rawvideo,rv,sami,srt,ssa,v210,vc1,vorbis,vp[6-9],wm,wrapped_avframe' --enable-demuxer='sub,ac3,ac,peg,web,au,ape,ass,avi,concat,dnxhd,dts,dash,flv,gif,hls,h264,hevc,kux,matroska,mov,mp3,mxf,ogg,pcm,rawvideo,rtp,spdif,srt,vc1,v210,wav,pipe,image2,mlv,nsv,nut' --enable-encoder='aac,cfhd,dnxhd,exr,ff,yuv,gif,h26[3-4],av1,hevc,mjpeg,png,opus,pcm,prores,rawvideo,spdif,speedhq,jpeg,png,tiff,vp[8-9],wrapped_avframe,nvenc,qsv,v4l2m2m,vaapi,vorbis' --enable-muxer='jpeg,dnxhd,fifo,flv,gif,hls,h264,hevc,image2,mov,mp4,mpegts,matroska,null,og,pcm,rawvideo,spdif,pipe,segment,webm,wav,dash,nu' flutter: mdk.INFO: 2023-08-25 16:59:27.337047: av_dict_set00007FFBD8198AC0 flutter: mdk.INFO: 2023-08-25 16:59:27.337047: Selected avformat runtime version: 60.10.100 (build: 60.10.100), license: LGPL version 2.1 or later flutter: mdk.INFO: 2023-08-25 16:59:27.337047: avformat_version00007FFBD81892B0 flutter: mdk.INFO: 2023-08-25 16:59:27.337047: Trying MediaIO FFmpeg for protocol "https" flutter: mdk.INFO: 2023-08-25 16:59:27.337047: 0000021B657DE3A0 open url: https://rr1---sn-cnoa-3aie.googlevideo.com/videoplayback?expire=1692984611&ei=w5DoZLezIbb2juMP95uE2AI&ip=59.95.6.178&id=o-APRZwdpK1JctYB0bHm0ZSG5LnzlLxaIHQZ0ABq2qYgbG&itag=17&source=youtube&requiressl=yes&mh=bG&mm=31%2C29&mn=sn-cnoa-3aie%2Csn-cvh76nes&ms=au%2Crdu&mv=m&mvi=1&pl=22&initcwndbps=763750&spc=UWF9f4BCNCoVGPATsn5O1Kcf4IMNDF6yr6jLn7NhVw&vprv=1&svpuc=1&mime=video%2F3gpp&gir=yes&clen=32913909&dur=5355.775&lmt=1599571544101225&mt=1692962713&fvip=2&fexp=24007246%2C24363392&beids=24350017&c=ANDROID&txp=7211222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgKCkYIHXPBjhb15HCRSRG5NbaunlOjT0ZfrkQJdA9Q0YCIQDhlnTJIol4fX2JvYw9gk1Ccas5cC90xdJvPCNb0GT0cw%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgVeiXFo893vBMJ-Fa_EJT3bFy9Ox8C-5aV7gckBUjMfcCICnf94ua9HENNSXFdj52C8nyXZGwBxbCH0OiJZb2r2aU flutter: mdk.INFO: 2023-08-25 16:59:27.363028: FFmpeg/Libav runtime git-2023-08-19-8c789c5-avbuild flutter: mdk.INFO: 2023-08-25 16:59:27.581586: [FFmpeg:https] HTTP error 403 Forbidden flutter: mdk.INFO: 2023-08-25 16:59:27.583586: Error avrt::avioopen2(&avio, ffmpeg::from_file_uri(in.c_str()), flags, &cb, &dict) @127 D:\a\mdk-sdk\mdk-sdk\mdk\ffmpeg\plugin\AVFormatIO.cpp: (0xcccfcb08) Server returned 403 Forbidden (access denied) flutter: mdk.WARNING: 2023-08-25 16:59:27.584586: 0000021B657DE3A0url open error flutter: mdk.WARNING: 2023-08-25 16:59:27.584586: Failed to create io for url. io: 0000021B657DE3A0, open: false flutter: mdk.INFO: 2023-08-25 16:59:27.584586: default 0000021B5B1C2B60 FrameReader::update MediaStatus 0X2=>0X2 flutter: mdk.INFO: 2023-08-25 16:59:27.584586: Selected avcodec runtime version: 60.23.100 (build: 60.23.100), license: LGPL version 2.1 or later flutter: mdk.INFO: 2023-08-25 16:59:27.584586: av_packet_alloc00007FFBD7CA3490 flutter: mdk.INFO: 2023-08-25 16:59:27.586585: before avformat_open_input. io: 0000000000000000(/pb: 0000000000000000, url: https://rr1---sn-cnoa-3aie.googlevideo.com/videoplayback?expire=1692984611&ei=w5DoZLezIbb2juMP95uE2AI&ip=59.95.6.178&id=o-APRZwdpK1JctYB0bHm0ZSG5LnzlLxaIHQZ0ABq2qYgbG&itag=17&source=youtube&requiressl=yes&mh=bG&mm=31%2C29&mn=sn-cnoa-3aie%2Csn-cvh76nes&ms=au%2Crdu&mv=m&mvi=1&pl=22&initcwndbps=763750&spc=UWF9f4BCNCoVGPATsn5O1Kcf4IMNDF6yr6jLn7NhVw&vprv=1&svpuc=1&mime=video%2F3gpp&gir=yes&clen=32913909&dur=5355.775&lmt=1599571544101225&mt=1692962713&fvip=2&fexp=24007246%2C24363392&beids=24350017&c=ANDROID&txp=7211222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgKCkYIHXPBjhb15HCRSRG5NbaunlOjT0ZfrkQJdA9Q0YCIQDhlnTJIol4fX2JvYw9gk1Ccas5cC90xdJvPCNb0GT0cw%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgVeiXFo893vBMJ-Fa_EJT3bFy9Ox8C-5aV7gckBUjMfcCICnf94ua9HENNSXFdj52C8nyXZGwBxbCH0OiJZb2r2aU flutter: mdk.INFO: 2023-08-25 16:59:27.815491: [FFmpeg:https] HTTP error 403 Forbidden flutter: mdk.INFO: 2023-08-25 16:59:27.816491: Error avrt::avformat_openinput(&fmtctx, ffmpeg::from_file_uri(in.c_str()), fmt, &dict) @207 D:\a\mdk-sdk\mdk-sdk\mdk\ffmpeg\plugin\FFmpegPacketIO.cpp: (0xcccfcb08) Server returned 403 Forbidden (access denied) flutter: mdk.INFO: 2023-08-25 16:59:27.816491: 1860default 0000021B5B1C2B60 bool cdecl mdk::abi::FrameReader::update(enum mdk::abi::MediaStatus) @1057: reset status_mask flutter: mdk.INFO: 2023-08-25 16:59:27.817496: default 0000021B5B1C2B60 FrameReader::update MediaStatus 0X2=>0X80000000 flutter: fvp.FINE: 2023-08-25 16:59:27.817496: 232830620 player2316695231424 onMediaStatusChanged: MediaStatus(+loading) => MediaStatus(+invalid) flutter: mdk.WARNING: 2023-08-25 16:59:27.829482: reader open error flutter: mdk.INFO: 2023-08-25 16:59:27.829482: default FrameReader0000021B5B1C2B60 state: 0=>1=>0, 1 flutter: mdk.SEVERE: 2023-08-25 16:59:27.830481: state not changed! flutter: mdk.INFO: 2023-08-25 16:59:27.840478: 0000021B658208C0 void cdecl mdk::abi::MediaControlPush::setState(enum mdk::abi::State)@969 requested state 2=>0, current state 0. status: 0X80000000 flutter: mdk.INFO: 2023-08-25 16:59:27.840478: default FrameReader0000021B5B1C2B60 state: 0=>0=>0, 0 flutter: mdk.INFO: 2023-08-25 16:59:27.841484: default0000021B5B1C2B60 void cdecl mdk::abi::FrameReader::stop(void), current state: 0 flutter: mdk.INFO: 2023-08-25 16:59:27.841484: 0000021B6591C770cdecl mdk::abi::Player::~Player(void)64
flutter: mdk.INFO: 2023-08-25 16:59:27.841484: setNext from -1 url: flutter: mdk.INFO: 2023-08-25 16:59:27.841484: default FrameReader0000021B5B1C2B60 state: 0=>0=>0, 0 flutter: mdk.INFO: 2023-08-25 16:59:27.841484: default0000021B5B1C2B60 void
cdecl mdk::abi::FrameReader::stop(void), current state: 0 flutter: mdk.INFO: 2023-08-25 16:59:27.842474: cdecl mdk::abi::MediaPlayer::Private::~Private(void) flutter: mdk.INFO: 2023-08-25 16:59:27.866460: 0000021B658208C0 void cdecl mdk::abi::MediaControlPush::setState(enum mdk::abi::State)@969 requested state 0=>0, current state 0. status: 0X80000000 flutter: mdk.INFO: 2023-08-25 16:59:27.866460: default0000021B5B1C2B60 deleting FrameReader... flutter: mdk.INFO: 2023-08-25 16:59:27.866460: 0000021B657DF8A0 void cdecl mdk::abi::MediaControlPush::setState(enum mdk::abi::State)@969 requested state 0=>0, current state 0. status: 0 flutter: mdk.INFO: 2023-08-25 16:59:27.867461: default0000021B657E5B50 deleting FrameReader... flutter: mdk.INFO: 2023-08-25 16:59:27.867461: player is destroyed flutter: mdk.INFO: 2023-08-25 16:59:27.867461: cdecl mdk::abi::VideoRenderer::Private::~Private(void) @125
Lost connection to device.

abdelaziz-mahdy commented 10 months ago

HTTP error 403 Forbidden, means that data couldnt be extracted due to autoriztion are you sure you used the right header?

floyd-lewis commented 10 months ago

Since this is a url in public domain. (I can view in browser) do I need special authorization. r u suggesting to view a youtube video in my player i need access ?

abdelaziz-mahdy commented 10 months ago

Since this is a url in public domain. (I can view in browser) do I need special authorization. r u suggesting to view a youtube video in my player i need access ?

if you try to access the url in google chrome image

abdelaziz-mahdy commented 10 months ago

image

i will update youtube_explode_dart to youtube_explode_dart: ^2.0.2

abdelaziz-mahdy commented 10 months ago

@floyd-lewis can you git pull latest changes and try again? now it works for me

floyd-lewis commented 10 months ago

Yes, confirmed it works. Will also test on android as it was not working there too. Never suspected the issue to stem form ...explode.... Thx!

abdelaziz-mahdy commented 10 months ago

Glad to know it was fixed , feel free to check on Android and close the issue if it works correctly

Thank you for explaining the issue that helped alot ❤️

floyd-lewis commented 10 months ago

I just tested on android. Get an error, Library not loading. Will attach a screen shot too

[flutter_meedu_videoplayer] Invalid argument(s): Failed to load dynamic library 'libmdk.so': dlopen failed: "/data/app/~~xpBC7GGC939BK6Z_9HGvgA==/com.zezo357.flutter_meedu_videoplayer_example-D0AHtAt6vEZXtTImbY44oA==/lib/x86/libmdk.so" has text relocations (https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-Enforced-for-API-level-23)
[flutter_meedu_videoplayer] #0      _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11:43)
#1      new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22:12)
#2      Libmdk._load
lib.dart:23
#3      Libmdk.instance
lib.dart:29
#4      Libmdk.instance (package:fvp/src/lib.dart)
lib.dart:1
#5      new Player
player.dart:484
#6      MdkVideoPlayer.create
video_player_mdk.dart:111
#7      VideoPlayerController.initialize
video_player.dart:426
#8      MeeduPlayerController.setDataSource
controller.dart:533
#9      _YoutubeExamplePageState._setDataSource
yotube_page_example.dart:123
#10     _YoutubeExamplePageState._playYoutubeVideo
yotube_page_example.dart:165
                            <asynchronous suspension>
#11     _YoutubeExamplePageState.build.<anonymous closure>.<anonymous closure>
yotube_page_example.dart:258
                            <asynchronous suspension>

[flutter_meedu_videoplayer] Fit is BoxFit.fill.
floyd-lewis commented 10 months ago

bug

abdelaziz-mahdy commented 10 months ago

will check it and let you know, for now can you test with

  initMeeduPlayer(
    androidUseFVP: false,
    iosUseFVP: false,
  );

it should work correctly

abdelaziz-mahdy commented 10 months ago

also i just tested and it works correctly on android in my example with androidUseFVP: true,

can you do a flutter clean and try rebuilding the android version and let me know what is the result?

also you are testing on my example without any changes correct? what is the emulator api version? mine is 31

floyd-lewis commented 10 months ago

I downloaded and unzipped your project from git, so the environment should be identical to yours. After doing a clean Android build failed as below irrespective of androidUseFVP.

Launching lib\pocMeeduPlayer.dart on sdk gphone x86 in debug mode... Building with Flutter multidex support enabled.

FAILURE: Build failed with an exception.

BUILD FAILED in 1m 37s Exception: Gradle task assembleDebug failed with exit code 1 Exited (sigterm)

abdelaziz-mahdy commented 10 months ago

Flutter clean and try again, fvp failed to download the files needed to run as mentioned

Make sure the internet is stable while building

floyd-lewis commented 10 months ago

Also am using Nexus 5 emulator.

abdelaziz-mahdy commented 10 months ago

When build is done (flutter clean and try again until a different error appears or it works)

Test and let me know the result since I tried and it worked for me using fvp

abdelaziz-mahdy commented 10 months ago

also for android use for now

 initMeeduPlayer(
    androidUseFVP: false,
    iosUseFVP: false,
  );

until this gets fixed https://github.com/wang-bin/fvp/issues/23 (for fixing this error [flutter_meedu_videoplayer] Invalid argument(s): Failed to load dynamic library 'libmdk.so': dlopen failed: "/data/app/~~xpBC7GGC939BK6Z_9HGvgA==/com.zezo357.flutter_meedu_videoplayer_example-D0AHtAt6vEZXtTImbY44oA==/lib/x86/libmdk.so" has text relocations (https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-Enforced-for-API-level-23) )

abdelaziz-mahdy commented 10 months ago

also i just did try a flutter clean and build and it worked for me now

floyd-lewis commented 10 months ago

Here another thing. I'm using shared_preferences package. flutter_meedu_videoplayer is using it too. In the main I am getting the instance. It fails. If I remove the flutter_meedu_videoplayer dependency there is no issue. On windows there is no issue. I suspect it is something to do with the failure (fpv?) on android.

E/flutter (30733): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null) E/flutter (30733):

abdelaziz-mahdy commented 10 months ago
E/flutter (30733): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
E/flutter (30733):

i dont think its related , can you terminate the app and try again? since this means the package for shared_preferences files are not added

did you try to use after hot restart? since this is may be the issue

floyd-lewis commented 10 months ago

I did a flutter clean and then pub get. And then debug. Here's the code, i call init in main. It appears that the shared_prefrence native part is buggered up when I include meedo.

import 'package:shared_preferences/shared_preferences.dart';

class PreferenceService { static late final SharedPreferences instance;

static Future init() async => instance = await SharedPreferences.getInstance(); }

floyd-lewis commented 10 months ago

Just a confirmation ...no problem on WIndows when i include meedu

abdelaziz-mahdy commented 10 months ago

I did a flutter clean and then pub get. And then debug. Here's the code, i call init in main. It appears that the shared_prefrence native part is buggered up when I include meedo.

import 'package:shared_preferences/shared_preferences.dart';

class PreferenceService { static late final SharedPreferences instance;

static Future init() async => instance = await SharedPreferences.getInstance(); }

on mobile it may fail due to speed, since windows is faster, also it may be due to android interface not being inilized to work yet

void main() {
  WidgetsFlutterBinding.ensureInitialized();
 initMeeduPlayer(
    androidUseFVP: false,
    iosUseFVP: false,
  );
  // add you shared prefrence call here 
  runApp(MyApp());
}

or

void main() async {
await initMeeduPlayer(
    androidUseFVP: false,
    iosUseFVP: false,
  );
  // add you shared prefrence call here 
  runApp(MyApp());
}

test that and let me know.

abdelaziz-mahdy commented 10 months ago

just tested and no errors

Future<void> main() async {
  await initMeeduPlayer(
    androidUseFVP: true,
    iosUseFVP: false,
  );
  await PreferenceService.init();

  runApp(const MyApp());
}

also this works

void main() {
  WidgetsFlutterBinding.ensureInitialized();

  initMeeduPlayer(
    androidUseFVP: true,
    iosUseFVP: false,
  );
  PreferenceService.init();

  runApp(const MyApp());
}
floyd-lewis commented 10 months ago

But for u ...the build for android succeeds. For me it does not. Here lies the problem. I just know that when i have meedu in the dependency ..shared_preference bombs.

abdelaziz-mahdy commented 10 months ago

The error you mentioned is fixed by any of the ways I mentioned

This is not related to the build, also fvp fixed the android issue and I did test it and it worked for me

If the build still fails for you let me know the error

floyd-lewis commented 10 months ago

Still fails. Here's the command line output. Am using androidFPV = true. Failing to load libfvp_plugin.so. Will try with FPV false too. Just a heads up.

PS F:\floyd\src\flutter\flutter_meedu_videoplayer\package\example> flutter clean Deleting build... 2,636ms Deleting .dart_tool... 26ms Deleting Generated.xcconfig... 11ms Deleting flutter_export_environment.sh... 0ms Deleting ephemeral... 3ms Deleting ephemeral... 4ms Deleting ephemeral... 25ms Deleting .flutter-plugins-dependencies... 4ms Deleting .flutter-plugins... 0ms PS F:\floyd\src\flutter\flutter_meedu_videoplayer\package\example> flutter pub add flutter_meedu_videoplayer Resolving dependencies... collection 1.17.1 (1.18.0 available) desktop_drop 0.4.1 (0.4.3 available) file 6.1.4 (7.0.0 available)

Flutter run key commands. r Hot reload. R Hot restart. h List all available interactive commands. d Detach (terminate "flutter run" but leave application running). c Clear the screen q Quit (terminate the application on the device).

A Dart VM Service on sdk gphone x86 is available at: http://127.0.0.1:53294/KiRTB4o77Sg=/ The Flutter DevTools debugger and profiler on sdk gphone x86 is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:53294/KiRTB4o77Sg=/ E/flutter (19318): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null) E/flutter (19318):

══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════ The following MissingPluginException was thrown while activating platform stream on channel com.kurenai7968.volume_controller.volume_listener_event: MissingPluginException(No implementation found for method listen on channel com.kurenai7968.volume_controller.volume_listener_event)

When the exception was thrown, this was the stack:

0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:308:7)

#1 EventChannel.receiveBroadcastStream. (package:flutter/src/services/platform_channel.dart:652:9) ════════════════════════════════════════════════════════════════════════════════════════════════════ I/AssistStructure(19318): Flattened final assist data: 504 bytes, containing 1 windows, 3 views Another exception was thrown: A RenderFlex overflowed by 0.0436 pixels on the right. I/flutter (19318): https://rr1---sn-cnoa-3ail.googlevideo.com/videoplayback?expire=1693046468&ei=ZILpZPz-I-jlrtoP-s6owAE&ip=59.95.6.208&id=o-AGqFYGfZNLGLMA3gpSozqGzlZpGOun5Is25iaSwp_jZ3&itag=22&source=youtube&requiressl=yes&mh=Vk&mm=31%2C29&mn=sn-cnoa-3ail%2Csn-cvhelnll&ms=au%2Crdu&mv=m&mvi=1&pl=22&pcm2=yes&initcwndbps=1151250&vprv=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=487.549&lmt=1678722446731390&mt=1693024396&fvip=4&fexp=24007246%2C24363392&beids=24350018&c=ANDROID_TESTSUITE&txp=4532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cpcm2%2Cvprv%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRgIhAJZ48Wyon18R3TyTDCSkHXAmlCk-bs1dZdNCMZx1W4g3AiEAxgZsrT8s9q5D4ZS0uM7uY4LJReYREy7ZxPko7EVoKAc%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhAN1NalPNA-2Occpwuq4WNSGCHBm4qt69-QdypTIh-_KwAiEA-1RJbs_GqzFJSDx80__vgnC5gRNwM8kWTLXtuIbevyo%3D E/flutter (19318): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null) E/flutter (19318): #0 AndroidVideoPlayerApi.initialize (package:video_player_android/src/messages.g.dart:271:7) E/flutter (19318): E/flutter (19318):
abdelaziz-mahdy commented 10 months ago

Please try with it as false and use one of the main implementations I mentioned please

floyd-lewis commented 10 months ago

Fails as below. It appears any plugin which accesses the channel throws the error. In my case it was the share_preferences. Here it appears to be the volume controller.

A Dart VM Service on sdk gphone x86 is available at: http://127.0.0.1:54987/lHiVlIeEjsA=/ The Flutter DevTools debugger and profiler on sdk gphone x86 is available at: http://127.0.0.1:9103?uri=http://127.0.0.1:54987/lHiVlIeEjsA=/ E/flutter (20596): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null) E/flutter (20596):

══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════ The following MissingPluginException was thrown while activating platform stream on channel com.kurenai7968.volume_controller.volume_listener_event: MissingPluginException(No implementation found for method listen on channel com.kurenai7968.volume_controller.volume_listener_event)

When the exception was thrown, this was the stack:

0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:308:7)

#1 EventChannel.receiveBroadcastStream. (package:flutter/src/services/platform_channel.dart:652:9) ════════════════════════════════════════════════════════════════════════════════════════════════════
floyd-lewis commented 10 months ago

Channel version 3.10.5

PS F:\floyd\src\flutter\flutter_meedu_videoplayer\package\example> flutter doctor Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 3.10.5, on Microsoft Windows [Version 10.0.19045.3324], locale en-IN) [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [√] Chrome - develop for the web [√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.6.5)
[√] Android Studio (version 2022.3) [√] Connected device (4 available) [√] Network resources

abdelaziz-mahdy commented 10 months ago

Fails as below. It appears any plugin which accesses the channel throws the error. In my case it was the share_preferences. Here it appears to be the volume controller.

A Dart VM Service on sdk gphone x86 is available at: http://127.0.0.1:54987/lHiVlIeEjsA=/ The Flutter DevTools debugger and profiler on sdk gphone x86 is available at: http://127.0.0.1:9103?uri=http://127.0.0.1:54987/lHiVlIeEjsA=/ E/flutter (20596): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null) E/flutter (20596):

══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════ The following MissingPluginException was thrown while activating platform stream on channel com.kurenai7968.volume_controller.volume_listener_event: MissingPluginException(No implementation found for method listen on channel com.kurenai7968.volume_controller.volume_listener_event)

When the exception was thrown, this was the stack:

0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:308:7)

#1 EventChannel.receiveBroadcastStream. (package:flutter/src/services/platform_channel.dart:652:9) ════════════════════════════════════════════════════════════════════════════════════════════════════

Can you please share your main function?

floyd-lewis commented 10 months ago

Some more input:- The example main needs to have WidgetsFlutterBinding.ensureInitialized(); and async await. (as right below). FYI I'm tinkering with the ndk version because of the below error:

E/flutter (24318): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'libfvp_plugin.so': dlopen failed: "/data/app/~~9wU42vMEMQEpkMS8nLBAcg==/com.zezo357.flutter_meedu_videoplayer_example-W0wRR5_oiFRx7CtkW60j1Q==/lib/x86/libmdk.so" has text relocations (https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-Enforced-for-API-level-23)

void main() async { WidgetsFlutterBinding.ensureInitialized(); Logger.root.level = Level.ALL; Logger.root.onRecord.listen((record) { print( '${record.loggerName}.${record.level.name}: ${record.time}: ${record.message}'); }); await initMeeduPlayer( androidUseFVP: true, iosUseFVP: false, ); runApp(const MyApp()); }