mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Add missing media session callback in UWP embedding.
This commit is contained in:
parent
c6049eda7b
commit
5de6074ad8
7 changed files with 58 additions and 24 deletions
|
@ -151,6 +151,14 @@ struct ServoControl : ServoControlT<ServoControl>, public servo::ServoDelegate {
|
|||
mOnCaptureGesturesEndedEvent.remove(token);
|
||||
}
|
||||
|
||||
winrt::event_token
|
||||
OnMediaSessionPosition(MediaSessionPositionDelegate const &handler) {
|
||||
return mOnMediaSessionPositionEvent.add(handler);
|
||||
};
|
||||
void OnMediaSessionPosition(winrt::event_token const &token) noexcept {
|
||||
mOnMediaSessionPositionEvent.remove(token);
|
||||
}
|
||||
|
||||
winrt::event_token
|
||||
OnMediaSessionMetadata(MediaSessionMetadataDelegate const &handler) {
|
||||
return mOnMediaSessionMetadataEvent.add(handler);
|
||||
|
@ -187,6 +195,7 @@ struct ServoControl : ServoControlT<ServoControl>, public servo::ServoDelegate {
|
|||
virtual void OnServoMediaSessionMetadata(winrt::hstring, winrt::hstring,
|
||||
winrt::hstring);
|
||||
virtual void OnServoMediaSessionPlaybackStateChange(int);
|
||||
virtual void OnServoMediaSessionPosition(double, double, double);
|
||||
virtual void OnServoPromptAlert(winrt::hstring, bool);
|
||||
virtual void OnServoShowContextMenu(std::optional<winrt::hstring>,
|
||||
std::vector<winrt::hstring>);
|
||||
|
@ -210,6 +219,7 @@ private:
|
|||
winrt::event<EventDelegate> mOnCaptureGesturesStartedEvent;
|
||||
winrt::event<EventDelegate> mOnCaptureGesturesEndedEvent;
|
||||
winrt::event<MediaSessionMetadataDelegate> mOnMediaSessionMetadataEvent;
|
||||
winrt::event<MediaSessionPositionDelegate> mOnMediaSessionPositionEvent;
|
||||
winrt::event<Windows::Foundation::EventHandler<int>>
|
||||
mOnMediaSessionPlaybackStateChangeEvent;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue