Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

[Bug] MediaElement crashes the program if navigated away from too quickly #1571

@NickCRowork

Description

@NickCRowork

Description

When using MediaElement in a Xamarin Forms application, if the page is navigated away from before the player finishes setting up, it will throw the exception: System.ObjectDisposedException: 'Cannot access a disposed object.
Object name: 'Xamarin.CommunityToolkit.UI.Views.FormsVideoView'.' This is when using a remote source for the video.
I've also seen this issue happen when the page with the video is navigated away from before the video with a remote source starts playing, but I've been unable to reliably reproduce that.
Version tested was Android. Unknown if error exists in IOS as well.

Steps to Reproduce

  1. Download the repro
  2. Click the open video button
  3. Click the back button before the black box of the video player appears

Expected Behavior

Page is navigated away from successfully.

Actual Behavior

App crashes.

Basic Information

  • Version with issue: 1.2.0
  • IDE: Visual Studio Community 2019
  • Platform Target Frameworks:
    • iOS: Xamarin default
    • Android: 11.0
  • Nuget Packages:
    NETStandard.Library
    Xamarin.CommunityToolkit
    Xamarin.Essentials
    Xamarin.Forms
  • Affected Devices:
    Motorola One 5G Ace - Android 10

Reproduction Link

https://github.com/NickCRowork/VideoViewError

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working. Breaky break.s/unverifiedThis issue needs verification/reproduction by a team member. PRs cannot be accepted/merged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions