Problem in mediaElement with Two collectionView's #2857
Unanswered
RobertoSSantana
asked this question in
Q&A
Replies: 1 comment 1 reply
-
ATM with IOS and MacOS mulitple collectionView's are not supported. That is on our TODO list of items that need to be updated. Here is a link to show where in code the issue is shown: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Here's a revised, clearer version of your text for posting on Stack Overflow, maintaining the technical context and improving readability:
I'm having an issue with the MediaElement in my Xamarin/.NET MAUI project: it's not working properly when I have two CollectionViews on the same screen.
At my company, we have a social network under maintenance, and we needed to add videos to posts. I placed the MediaElement inside a template that's selected based on the post type. This way, we load the posts, and for posts with videos, the video template is displayed.
The problem is:
On Android, the app crashes occasionally.
On iOS, the video doesn't play, and an error appears indicating that the MediaElement is in two collections.
At the time of posting, I didn't have my company MacBook with me, so I couldn't test it directly on iOS.
Here's an excerpt from my relevant XAML:
`
<CollectionView.ItemTemplate>
</CollectionView.ItemTemplate>
<mpowerkit:VirtualizeListView x:Name="FeedCollectionView"
ItemsSource="{Binding Posts}"
ItemTemplate="{StaticResource PostSelector}"
Scrolled="FeedCollectionView_Scrolled"
RemainingItemsThreshold="10"
ThresholdCommand="{Binding LoadMoreCommand}" />
<toolkit:MediaElement x:Name="mediaElementPost"
Aspect="AspectFit"
ShouldKeepScreenOn="False"
ShouldAutoPlay="True"
ShouldLoopPlayback="True"
Source="{Binding Picture}"/>
`
Has anyone experienced something similar or know how I can use MediaElement in multiple CollectionView without the app crashing on Android or giving an error on iOS?
Beta Was this translation helpful? Give feedback.
All reactions