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

Can the playback of m3u8 be easier? #65

Closed AnonymHK closed 1 year ago

AnonymHK commented 1 year ago

I have looked at the play example code of m3u8, which is too complex. Can you consider encapsulating the playback code? For using a player, we should not consider too much processing [some may need customization?], perhaps we should consider using 'fluent' hls Parser 'or simply encapsulate the parsing into a function and call the play function directly??

abdelaziz-mahdy commented 1 year ago

I found code examples for parsing m3u8 files and caching on another player, https://pub.flutter-io.cn/packages/lecle_yoyo_player

There are examples of the urlCheck function in the 'video. dart' file. I am currently studying Flutter and will submit Pull in the future to improve this component. I really like it and thank you for providing such an excellent component!

... By the way, the name 'flutter_meedu_videoplayer' is too long. Can you consider streamlining or optimizing it? At least make sure that meedu and videoplayer do not constantly prompt for spelling errors in English words during code checking in Android Studio! Of course, this is just a small wish, whether to change or not is not important!!

The name video player is annoying me too😅 but I don't think the renaming is easy due to conflicts in pub release

For the m3u8 I tried to leave it outside the player to provide the customization for people to manage,

just to avoid reducing customization.

If you can make a pr I would love that.

abdelaziz-mahdy commented 1 year ago

I have looked at the play example code of m3u8, which is too complex. Can you consider encapsulating the playback code? For using a player, we should not consider too much processing [some may need customization?], perhaps we should consider using 'fluent' hls Parser 'or simply encapsulate the parsing into a function and call the play function directly??

Also for the using packages, I didn't find any that works in my case, since we need to parse m3u8 and create other files with only one quality

And I did see the package you mentioned and used a similar logic like it.

abdelaziz-mahdy commented 1 year ago

Are you in Egypt? I don't know much about Egypt. I tried Google to search for Egyptian mythology. Is Ptah the god who protects craftsmen and artists? Other names are too long, how about 'ptah_video_player'? Perhaps you like the little bee, it's very diligent. How about 'bees_video_player'?

The problem is pub.dev will consider it a new package which will confuse people 😅 and will cut updates to people

If I remember correctly you can set those words in the android studio work place. (Don't remember how)

abdelaziz-mahdy commented 1 year ago

看了m3u8的播放示例代码,太复杂了。可以考虑封装播放代码吗?对于使用播放器,我们不应该考虑太多的处理[有些可能需要定制?],或许我们应该考虑使用'fluent'_hls_Parser'或者干脆把解析封装成一个函数直接调用play函数??

同样对于使用包,我没有找到任何适用于我的情况,因为我们需要解析 m3u8 并创建只有一种质量的其他文件

我确实看到了你提到的包并使用了类似的逻辑。

I have looked at the play example code of m3u8, which is too complex. Can you consider encapsulating the playback code? For using a player, we should not consider too much processing [some may need customization?], perhaps we should consider using 'fluent' hls Parser 'or simply encapsulate the parsing into a function and call the play function directly??

Also for the using packages, I didn't find any that works in my case, since we need to parse m3u8 and create other files with only one quality

And I did see the package you mentioned and used a similar logic like it.

Would you consider automatically processing the file format of m3u8 in the next version? After all, it is a very common module! What the vast majority of people want is to provide a URL for m3u8. The player can play videos directly, which is such a simple logic, and they don't want to handle file parsing and other operations themselves. I tested several well-known players, and they can all directly pass the URL of m3u8 and play it without the need for developers to do any further processing! I haven't been learning Flutter for long, so I can only provide you with advice. Currently, I can't handle complex code logic on my own! Of course, I will learn as soon as possible and look forward to participating in the growth of this component!

You can play m3u8 urls directly (will auto pick best quality based on internet connection speed).

The example I did provide is for extracting qualities from m3u8, and provide a button to change qualities.