Maui
Maui copied to clipboard
Reinstate MediaElement MediaWidth & MediaHeight functionality
Description of Change
It seems like we never implemented the functionality to populate MediaWidth and MediaHeight. This PR fixes that.
While I did change some APIs I don't think it should be breaking changes.
- Populate
MediaWidthandMediaHeightfor iOS, Android, macOS, Windows and Tizen- Might not always show for live streamed content on iOS/macOS
- Moved the
PositionandDurationlabels in the sample app to under the slider that also shows the current playback position - Added a field right under the video to show the dimensions
- Switched around some properties in
MediaElement.shared.csso that we can set the values from ourMediaManagerbut they are read-only properties to the outside work - Updated comment on the above properties to reflect that sometimes width/height are not reported for iOS/macOS
Linked Issues
- Fixes #1708
PR Checklist
- [x] Has a linked Issue, and the Issue has been
approved(bug) orChampioned(feature/proposal) - [x] Has tests
- [x] Has samples
- [x] Rebased on top of
mainat time of PR - [x] Changes adhere to coding standard
- [x] Documentation created or updated: https://github.com/MicrosoftDocs/CommunityToolkit/pull/430
Thanks @jfversluis for adding the functionality to get the media width and height.
I ran a few tests and it worked very good on Android, iOS and MacCatalyst. I'm unable to test it on Windows, maybe somebody else can give us a hand with the Windows testing.
@ne0rrmatrix would you mind maybe testing this for a bit? Especially Windows but if you have some time poke at the rest too just so we have an extra set of eyes that looked at this :)
I'll take a look at it now
Works exactly as expected on Android and Windows. On iOS it behaves as expected on everything except HLS where it shows 0x0 and does not get width or height. I'm Going to test on a physical device to double check this is not a bug in emulator.
except HLS where it shows 0x0 and does not get width or height
This is (unfortunately) expected