-
-
Notifications
You must be signed in to change notification settings - Fork 281
Adding a MediaPlayerElement to Maui - Updated #361
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
Conversation
|
CI complaining with some weird errors, SDK related likely.. I think I had similar issues when doing the Uno part.. will investigate https://gist.github.com/mfkl/c91642258c79f752c9541da5094c6777 And as before, I cannot reproduce locally. |
|
On your branch, CI restores only this: On current 3.x, it restores all projects. Maybe something with the libvlcsharp.sln changes? |
|
It's because I removed everything from build manager except what I need. Let's see what I can do. |
...Sharp.MAUI.Sample.MediaElement.Multiple/LibVLCSharp.MAUI.Sample.MediaElement.Multiple.csproj
Outdated
Show resolved
Hide resolved
samples/MAUI/LibVLCSharp.MAUI.Sample.MediaElement/LibVLCSharp.MAUI.Sample.MediaElement.csproj
Outdated
Show resolved
Hide resolved
samples/MAUI/LibVLCSharp.MAUI.Sample.MediaElement/Platforms/Tizen/Main.cs
Outdated
Show resolved
Hide resolved
|
Hi there! I tested your code, and overall it works pretty well. However, I encountered some issues when playing network streams, specifically with HLS (m3u8) or DASH (mpd). When I try to seek using the progress bar, it doesn’t work as expected. After dragging to a specific position, the playback either jumps back or resets to the starting point. Interestingly, if I long-press the progress bar at the desired position, it sometimes successfully seeks to that spot, but the overall seeking behavior is very inconsistent. This happens on both Android and iOS. I'm not sure if the issue is with LibVLCSharp or MediaElement. For reference, I’ve tested the same HLS or DASH streams in the VLC apps from Google Play and App Store, and they work perfectly. Thanks for your help! |
|
Hi @mrsleepman, Thank you for trying out this code and for sharing your feedback! I'm very happy to hear that it "mostly" works on both Android and iOS. As you might know, this MediaElement control is meant to provide the best plug&play experience out of the box but will probably never support all the advanced features you would find in an advanced custom made video player. That being said, I’ve seen similar reports regarding seeking issues with HLS and DASH streams. These types of streams handle seeking differently, often requiring the player to jump between segments, which can make precise seeking challenging. And this code is a port from existing implementations, so it might inherit some underlying issues, I'm not sure yet, I have to investigate. Maybe one option to improve this could be using a queue to prioritize seek operations or implementing a debouncing mechanism to skip unnecessary seeks. However, this could be a lot of work and these potential solutions that would need further testing. But I will have a look. If you have any links to specific streams where this issue is particularly noticeable, feel free to share them. It would help me try to reproduce the issue more accurately. Thanks again for your input! |
|
Hi there! I spent some time debugging this issue today and found that it might be a logical problem. During the process of dragging the seek bar, the "SeekBar_ValueChanged" event gets triggered repeatedly. The longer the drag lasts, the more times "SeekBar_ValueChanged" is executed, which might be why the time isn’t being set correctly. Here’s the current code where the event "SeekBar.ValueChanged" is bound: To resolve this, I tried testing it by using "SeekBar.DragStarted" and "SeekBar.DragCompleted", and it seems to work properly: Additionally, I made some adjustments to prevent conflicts between the player and the user while interacting with the seek bar: Your original code was really cool and solved a lot of issues! I hope these changes from my testing can help resolve this particular problem. |
|
I have to test it (early next week) but it looks like indeed this will solve the time bug. Thanks for looking into this further. Does this code solve the problem you reported while seeking in video streams? |
|
I tried to minimize changes based on your code and the time is now correctly updated after a manual seek. |
CI breaking again for some reason, with a stupid error message. |
I tested your latest code with the implementation that only adds the DragCompleted event. Unfortunately, this change alone isn’t enough to make it work correctly. The conflict between the ValueChanged event and the DragCompleted event still exists—they are both trying to control the seek bar, which leads to issues. Here’s a DASH test stream I found on Google that I used for testing: |
For me, the way to resolve this issue was by modifying the global.json file to match the SDK version installed on my system. Here's the SDK version I have: This change made everything work correctly on my end. Hope this helps! |
|
Yep, thanks, but this PR makes no changes to the CI or global.json, so I'm not sure why the pipeline suddenly fails to install the proper SDK. I also cannot reproduce when building this branch in a pipeline from my fork. It was building fine before that last commit, so my guess is Azure Pipelines is buggy for this PR specifically.. |
|
Ok, last changes seem fine, thanks. CI is OK (besides the usual randomly crashing native test..). Will test one last time on Android and iOS when I can, and merge. If anyone feels like doing more testing in the meantime, be my guest! |
|
Thanks a lot @jonx! (for your work and patience) Aiming for a release early next week. |
Description of Change
This PR includes the implementation of a MediaPlayerElement for Maui. The changes include:
Issues Resolved
Other Changes
None
Platforms Affected
Behavioral/Visual Changes
None
Before/After Screenshots
Testing Procedure
I was not able to test this on iOS
PR Checklist