The 4.x -> 5.x release folded `EventContext` into `Mpv` and made
`wait_event` take `&mut self`, so the previous design (a single
`Arc<Mpv>` shared between the message and event threads, with the event
thread constructing its own `EventContext` from `mpv.ctx`) no longer
compiles.
Migration:
- Build the main `Mpv` (with `wid`, `title`, etc.) and use it from the
message thread for commands and `set_property`.
- `create_client(None)` a sub-client `Mpv`, owned by the event thread,
which calls `disable_deprecated_events`/`observe_property`/`wait_event`
on itself. Global events (`EndFile`, `Shutdown`) and property changes
observed by this client land in its event queue.
- Replace the old `MpvExt::wake_up` (which woke the main `Mpv`) with an
`EventClientWakeup` holding the sub-client's `mpv_handle` pointer, so
the message thread can interrupt the event thread's blocking
`wait_event` after pushing a new observe request onto the channel.
Also removed the `PropertyData::Node(_)` match arm in
`communication.rs`: 5.0.0 dropped `mpv_node` support, so the variant no
longer exists and the match is exhaustive without it.
https://claude.ai/code/session_01CuGHFREBZFkf8tfaiRV4K6
Commit 0b882f3 synthesized an Event::EndFile(Error) whenever
event_context.wait_event returned libmpv2::Error::Raw and forwarded it
to the web layer. MPV is fully able to continue playback after such
transient errors (its demuxer cache is intact), so fabricating an
end-of-file caused long-running HTTP streams (e.g. RealDebrid) to flip
to a blocking "Loading failed" overlay mid-playback. Revert that branch
to the prior log-and-continue behavior.
Also downgrade PlayerEnded errors from critical:true to critical:false
so genuine mpv_end_file_reason::Error surfaces as a 3s toast in
stremio-web (Player.js), letting the user retry, instead of an
unrecoverable full-screen overlay.