dioxus_web/events/
media.rs

1use super::{Synthetic, WebEventExt};
2use dioxus_html::HasMediaData;
3
4impl HasMediaData for Synthetic<web_sys::Event> {
5    fn as_any(&self) -> &dyn std::any::Any {
6        &self.event
7    }
8}
9
10impl WebEventExt for dioxus_html::MediaData {
11    type WebEvent = web_sys::Event;
12
13    #[inline(always)]
14    fn try_as_web_event(&self) -> Option<Self::WebEvent> {
15        self.downcast::<web_sys::Event>().cloned()
16    }
17}