syonip / flutter_fbstorage_video_upload

MIT License
34 stars 31 forks source link

m3u8 file string update issue #7

Open hyobbb opened 3 years ago

hyobbb commented 3 years ago

Hi. I'd like to ask you about playlistUrl update.

image

As you can see the file type of 'm3u8' extensions is recognized as stream file not audo_mpegUrl. I am appending 'video%2F$videoName%2F' in front because I save those folders in subfolder of 'video' folder. The updated contents is like below(videoName is different because screenshot is from other trial but it resulted the same)

I/flutter ( 4151): #EXTM3U
I/flutter ( 4151): #EXT-X-VERSION:3
I/flutter ( 4151): #EXT-X-STREAM-INF:BANDWIDTH=683098,RESOLUTION=640x360,CODECS="avc1.42c01e,mp4a.40.2"
I/flutter ( 4151): video%2F1605666932022%2F0_playlistVariant.m3u8?alt=media
I/flutter ( 4151): 
I/flutter ( 4151): #EXT-X-STREAM-INF:BANDWIDTH=2481598,RESOLUTION=1280x720,CODECS="avc1.42c01f,mp4a.40.2"
I/flutter ( 4151): video%2F1605666932022%2F1_playlistVariant.m3u8?alt=media
I/flutter ( 4151): 
I/flutter ( 4151): #EXT-X-STREAM-INF:BANDWIDTH=5781598,RESOLUTION=1920x1080,CODECS="avc1.42c028,mp4a.40.2"
I/flutter ( 4151): video%2F1605666932022%2F2_playlistVariant.m3u8?alt=media

appending logic is like:

if (line.contains('.ts') || line.contains('.m3u8')) {
            updatedLine = '$video%2F$videoName%2F$line?alt=media';
          }

where $video refers 'video'.

Do you have any idea how to fix this issue? Thanks in advance.

hyobbb commented 3 years ago

another question is that.. if it is relative path then in my case where every files are in same location it should work without additional folder name right? well.. but it doesn't work either.

syonip commented 3 years ago

Hi @hyobbb , Firebase Cloud Storage infers the file type automatically, but if you want to override it you can, as described here: https://firebase.google.com/docs/storage/web/upload-files#add_file_metadata

hyobbb commented 3 years ago

Hi @hyobbb , Firebase Cloud Storage infers the file type automatically, but if you want to override it you can, as described here: https://firebase.google.com/docs/storage/web/upload-files#add_file_metadata

Hi. Well the problem is that I can't play it. Do you see any problem on that file string?

syonip commented 3 years ago

To test the file you can get the download url and put it in one of the online hls players. Search "test hls stream" on google.

hyobbb commented 3 years ago

https://firebasestorage.googleapis.com/v0/b/ssup-proto.appspot.com/o/video%2F1605675388681%2Fmaster.m3u8?alt=media&token=75671128-66f2-4e49-ba1b-ff33e522d7bf

tested with chorme hls extension but it keeps buffering and never play :(

syonip commented 3 years ago

Looking at your file, the links to the variant don't contain the folder prefix. Check this comment: https://github.com/syonip/flutter_fbstorage_video_upload/issues/6#issuecomment-722932519