Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
floyd-lewis opened this issue Aug 25, 2023 · 34 comments
Open

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

floyd-lewis opened this issue Aug 25, 2023 · 34 comments
Labels
good first issue Good for newcomers

Comments

@floyd-lewis
Copy link

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

@abdelaziz-mahdy
Copy link
Owner

abdelaziz-mahdy commented Aug 25, 2023

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
Copy link
Author

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: 0000021B6591C770__cdecl 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::avio_open2(&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_open_input(&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: 0000021B6591C770__cdecl 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
Copy link
Owner

abdelaziz-mahdy commented Aug 25, 2023

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

@floyd-lewis
Copy link
Author

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
Copy link
Owner

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
Copy link
Owner

image

i will update youtube_explode_dart to youtube_explode_dart: ^2.0.2

@abdelaziz-mahdy
Copy link
Owner

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

@abdelaziz-mahdy abdelaziz-mahdy added the good first issue Good for newcomers label Aug 25, 2023
@floyd-lewis
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

floyd-lewis commented Aug 25, 2023

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
Copy link
Author

bug

@abdelaziz-mahdy
Copy link
Owner

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

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

it should work correctly

@abdelaziz-mahdy
Copy link
Owner

abdelaziz-mahdy commented Aug 25, 2023

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
Copy link
Author

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.

  • What went wrong:
    Execution failed for task ':fvp:configureCMakeDebug[arm64-v8a]'.

[CXX1405] error when building with cmake using C:\Users\floyd.lewis\AppData\Local\Pub\Cache\hosted\pub.dev\fvp-0.3.0\android\CMakeLists.txt: -- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Users/floyd.lewis/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- [download 100% complete]
-- [download 0% complete]
-- [download 1% complete]
-- [download 2% complete]
-- [download 3% complete]
-- [download 4% complete]
-- [download 5% complete]
-- [download 6% complete]
-- [download 7% complete]
-- [download 8% complete]
-- [download 9% complete]
-- [download 10% complete]
-- [download 11% complete]
-- [download 12% complete]
-- [download 13% complete]
-- [download 14% complete]
-- [download 15% complete]
-- [download 16% complete]
-- [download 17% complete]
-- [download 18% complete]
-- [download 19% complete]
-- [download 20% complete]
-- [download 21% complete]
-- [download 22% complete]
-- [download 23% complete]
-- [download 24% complete]
-- [download 25% complete]
-- [download 26% complete]
-- [download 27% complete]
-- [download 28% complete]
-- [download 29% complete]
-- [download 30% complete]
-- [download 31% complete]
-- [download 32% complete]
-- [download 33% complete]
-- [download 34% complete]
-- [download 35% complete]
-- [download 36% complete]
-- [download 37% complete]
-- [download 38% complete]
-- [download 39% complete]
-- [download 40% complete]
-- [download 41% complete]
-- [download 42% complete]
-- [download 43% complete]
-- [download 44% complete]
-- [download 45% complete]
-- [download 46% complete]
-- [download 47% complete]
-- [download 48% complete]
-- [download 49% complete]
-- [download 50% complete]
-- [download 51% complete]
-- [download 52% complete]
-- [download 53% complete]
-- [download 54% complete]
-- [download 55% complete]
-- [download 56% complete]
-- [download 57% complete]
-- [download 58% complete]
-- [download 59% complete]
-- Detecting CXX compiler ABI info
-- [download 60% complete]
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Users/floyd.lewis/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring incomplete, errors occurred!
See also "C:/Users/floyd.lewis/AppData/Local/Pub/Cache/hosted/pub.dev/fvp-0.3.0/android/.cxx/Debug/3t5k4f6l/arm64-v8a/CMakeFiles/CMakeOutput.log".

C++ build system [configure] failed while executing:
@echo off
"C:\Users\floyd.lewis\AppData\Local\Android\Sdk\cmake\3.18.1\bin\cmake.exe" ^
"-HC:\Users\floyd.lewis\AppData\Local\Pub\Cache\hosted\pub.dev\fvp-0.3.0\android" ^
"-DCMAKE_SYSTEM_NAME=Android" ^
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" ^
"-DCMAKE_SYSTEM_VERSION=16" ^
"-DANDROID_PLATFORM=android-16" ^
"-DANDROID_ABI=arm64-v8a" ^
"-DCMAKE_ANDROID_ARCH_ABI=arm64-v8a" ^
"-DANDROID_NDK=C:\Users\floyd.lewis\AppData\Local\Android\Sdk\ndk\23.1.7779620" ^
"-DCMAKE_ANDROID_NDK=C:\Users\floyd.lewis\AppData\Local\Android\Sdk\ndk\23.1.7779620" ^
"-DCMAKE_TOOLCHAIN_FILE=C:\Users\floyd.lewis\AppData\Local\Android\Sdk\ndk\23.1.7779620\build\cmake\android.toolchain.cmake" ^
"-DCMAKE_MAKE_PROGRAM=C:\Users\floyd.lewis\AppData\Local\Android\Sdk\cmake\3.18.1\bin\ninja.exe" ^
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=F:\floyd\src\flutter\learning_beanstalk\build\fvp\intermediates\cxx\Debug\3t5k4f6l\obj\arm64-v8a" ^
"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=F:\floyd\src\flutter\learning_beanstalk\build\fvp\intermediates\cxx\Debug\3t5k4f6l\obj\arm64-v8a" ^
"-DCMAKE_BUILD_TYPE=Debug" ^
"-BC:\Users\floyd.lewis\AppData\Local\Pub\Cache\hosted\pub.dev\fvp-0.3.0\android\.cxx\Debug\3t5k4f6l\arm64-v8a" ^
-GNinja ^
"-DANDROID_STL=c++_shared"
from C:\Users\floyd.lewis\AppData\Local\Pub\Cache\hosted\pub.dev\fvp-0.3.0\android
CMake Warning at C:/Users/floyd.lewis/AppData/Local/Android/Sdk/ndk/23.1.7779620/build/cmake/android-legacy.toolchain.cmake:416 (message):
An old version of CMake is being used that cannot automatically detect
compiler attributes. Compiler identification is being bypassed. Some
values may be wrong or missing. Update to CMake 3.19 or newer to use
CMake's built-in compiler identification.
Call Stack (most recent call first):
C:/Users/floyd.lewis/AppData/Local/Android/Sdk/ndk/23.1.7779620/build/cmake/android.toolchain.cmake:55 (include)
C:/Users/floyd.lewis/AppData/Local/Android/Sdk/cmake/3.18.1/share/cmake-3.18/Modules/CMakeDetermineSystem.cmake:93 (include)
CMakeLists.txt:8 (project)

CMake Warning at C:/Users/floyd.lewis/AppData/Local/Android/Sdk/ndk/23.1.7779620/build/cmake/android-legacy.toolchain.cmake:416 (message):
An old version of CMake is being used that cannot automatically detect
compiler attributes. Compiler identification is being bypassed. Some
values may be wrong or missing. Update to CMake 3.19 or newer to use
CMake's built-in compiler identification.
Call Stack (most recent call first):
C:/Users/floyd.lewis/AppData/Local/Android/Sdk/ndk/23.1.7779620/build/cmake/android.toolchain.cmake:55 (include)
C:/Users/floyd.lewis/AppData/Local/Pub/Cache/hosted/pub.dev/fvp-0.3.0/android/.cxx/Debug/3t5k4f6l/arm64-v8a/CMakeFiles/3.18.1-g262b901-dirty/CMakeSystem.cmake:6 (include)
C:/Users/floyd.lewis/AppData/Local/Pub/Cache/hosted/pub.dev/fvp-0.3.0/android/.cxx/Debug/3t5k4f6l/arm64-v8a/CMakeFiles/CMakeTmp/CMakeLists.txt:2 (project)

Downloading mdk-sdk from https://sourceforge.net/projects/mdk-sdk/files/nightly/mdk-sdk-android.7z
CMake Warning at C:/Users/floyd.lewis/AppData/Local/Android/Sdk/ndk/23.1.7779620/build/cmake/android-legacy.toolchain.cmake:416 (message):
An old version of CMake is being used that cannot automatically detect
compiler attributes. Compiler identification is being bypassed. Some
values may be wrong or missing. Update to CMake 3.19 or newer to use
CMake's built-in compiler identification.
Call Stack (most recent call first):
C:/Users/floyd.lewis/AppData/Local/Android/Sdk/ndk/23.1.7779620/build/cmake/android.toolchain.cmake:55 (include)
C:/Users/floyd.lewis/AppData/Local/Android/Sdk/cmake/3.18.1/share/cmake-3.18/Modules/CMakeDetermineSystem.cmake:93 (include)
CMakeLists.txt:8 (project)

CMake Warning at C:/Users/floyd.lewis/AppData/Local/Android/Sdk/ndk/23.1.7779620/build/cmake/android-legacy.toolchain.cmake:416 (message):
An old version of CMake is being used that cannot automatically detect
compiler attributes. Compiler identification is being bypassed. Some
values may be wrong or missing. Update to CMake 3.19 or newer to use
CMake's built-in compiler identification.
Call Stack (most recent call first):
C:/Users/floyd.lewis/AppData/Local/Android/Sdk/ndk/23.1.7779620/build/cmake/android.toolchain.cmake:55 (include)
C:/Users/floyd.lewis/AppData/Local/Pub/Cache/hosted/pub.dev/fvp-0.3.0/android/.cxx/Debug/3t5k4f6l/arm64-v8a/CMakeFiles/3.18.1-g262b901-dirty/CMakeSystem.cmake:6 (include)
C:/Users/floyd.lewis/AppData/Local/Pub/Cache/hosted/pub.dev/fvp-0.3.0/android/.cxx/Debug/3t5k4f6l/arm64-v8a/CMakeFiles/CMakeTmp/CMakeLists.txt:2 (project)

CMake Error: Problem with archive_read_next_header():
CMake Error: Problem extracting tar: C:/Users/floyd.lewis/AppData/Local/Pub/Cache/hosted/pub.dev/fvp-0.3.0/android/mdk-sdk-android.7z
CMake Error at CMakeLists.txt:64 (message):
Failed to extract mdk-sdk. You can download manually from
https://sourceforge.net/projects/mdk-sdk/files/nightly/mdk-sdk-android.7z
and extract to
C:/Users/floyd.lewis/AppData/Local/Pub/Cache/hosted/pub.dev/fvp-0.3.0/android

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

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

@abdelaziz-mahdy
Copy link
Owner

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
Copy link
Author

Also am using Nexus 5 emulator.

@abdelaziz-mahdy
Copy link
Owner

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
Copy link
Owner

abdelaziz-mahdy commented Aug 25, 2023

also for android use for now

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

until this gets fixed wang-bin/fvp#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
Copy link
Owner

abdelaziz-mahdy commented Aug 25, 2023

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

@floyd-lewis
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

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

@abdelaziz-mahdy
Copy link
Owner

abdelaziz-mahdy commented Aug 25, 2023

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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_meedu_videoplayer 4.3.1 (was 4.3.0+1 from path ..)

fvp 0.3.0 (was 0.2.1)
matcher 0.12.15 (0.12.16 available)
material_color_utilities 0.2.0 (0.8.0 available)
petitparser 5.4.0 (6.0.1 available)
screen_brightness 0.2.2 (0.2.2+1 available)
source_span 1.9.1 (1.10.0 available)
stack_trace 1.11.0 (1.11.1 available)
stream_channel 2.1.1 (2.1.2 available)
test_api 0.5.1 (0.6.1 available)
visibility_detector 0.3.3 (0.4.0+2 available)
win32 5.0.6 (5.0.7 available)
xml 6.3.0 (6.4.2 available)
Changed 2 dependencies!
PS F:\floyd\src\flutter\flutter_meedu_videoplayer\package\example> flutter run --debug -d emulator-5554
Using hardware rendering with device sdk gphone x86. If you notice graphics artifacts, consider enabling software rendering with"--enable-software-rendering".
Launching lib\main.dart on sdk gphone x86 in debug mode...
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Users\floyd.lewis\AppData\Local\Pub\Cache\hosted\pub.dev\native_device_orientation-1.1.4\android\src\main\java\com\github\rmtmckenzie\native_device_orientation\NativeDeviceOrientationPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: C:\Users\floyd.lewis\AppData\Local\Pub\Cache\hosted\pub.dev\flutter_meedu_videoplayer-4.3.1\android\src\main\java\com\zezo357\flutter_meedu_videoplayer\FlutterMeeduVideoplayerPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Running Gradle task 'assembleDebug'... 301.9s
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app-debug.apk... 2,892ms
E/linker (19318): "/data/app/~~GC1_glfon1RtTxom3guKhw==/com.zezo357.flutter_meedu_videoplayer_example-sTbjxVVLFB5K_o-t7nPTzw==/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)

E/flutter (19318): [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/~~GC1_glfon1RtTxom3guKhw==/com.zezo357.flutter_meedu_videoplayer_example-sTbjxVVLFB5K_o-t7nPTzw==/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)

E/flutter (19318): #0 _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11:43)
E/flutter (19318): #1 new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22:12)
E/flutter (19318): #2 Libfvp._load (package:fvp/src/lib.dart:48:29)
E/flutter (19318): #3 Libfvp.instance (package:fvp/src/lib.dart:54:27)
E/flutter (19318): #4 Libfvp.instance (package:fvp/src/lib.dart)
E/flutter (19318): #5 Libfvp.isEmulator (package:fvp/src/lib.dart:61:29)
E/flutter (19318): #6 Libfvp.isEmulator (package:fvp/src/lib.dart)
E/flutter (19318): #7 EmulatorPlatform.isAndroidEmulator (package:fvp/src/extensions.dart:16:19)
E/flutter (19318): #8 MdkVideoPlayer.registerVideoPlayerPlatformsWith (package:fvp/src/video_player_mdk.dart:54:23)
E/flutter (19318): #9 registerWith (package:fvp/fvp.dart:33:18)
E/flutter (19318): #10 initMeeduPlayer (package:flutter_meedu_videoplayer/init_meedu_player.dart:19:5)
E/flutter (19318): #11 main (package:flutter_meedu_videoplayer_example/main.dart:14:3)
E/flutter (19318): #12 _runMain. (dart:ui/hooks.dart:131:23)
E/flutter (19318): #13 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:296:19)
E/flutter (19318): #14 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189:12)
E/flutter (19318):
Syncing files to device sdk gphone x86... 1,493ms

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
Copy link
Owner

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

@floyd-lewis
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants