microsoft / live-share-sdk

A framework for building collaborative Microsoft Teams and M365 experiences.
Other
94 stars 29 forks source link

MediaPlayerSynchronizer groupaction events now emit ignored actions during suspension, with ignored reason #754

Closed huntj88 closed 6 months ago

huntj88 commented 6 months ago

MediaPlayerSynchronizer groupaction events now emit ignored actions during suspension, with ignored reason.

Feature request #749

Test scenario and emitted events.

added console logs of group actions to sample 21.react-media-template

synchronizerRef.current.on(
    MediaPlayerSynchronizerEvents.groupaction,
    (event: ExtendedMediaSessionActionDetails) => {
        console.log("groupaction", event);
    }
);
  1. User in control clicks play

    {
    "type": "groupaction",
    "details": {
        "action": "play",
        "source": "user",
        "clientId": "2c9f76b0-805e-4e92-8063-20bea9901177",
        "local": false,
        "seekTime": 1.914871
    }
    }
  2. User not in control starts a suspension by seeking. No event emitted on groupAction.

  3. User in control clicks pause, but is ignored by local client with reason localusersuspended. This still affected the group state so the event gets emitted with groupaction

    {
    "type": "groupaction",
    "details": {
        "action": "pause",
        "source": "user",
        "clientId": "2c9f76b0-805e-4e92-8063-20bea9901177",
        "local": false,
        "seekTime": 8.408734,
        "ignoreReason": "localusersuspended"
    }
    }
  4. User not in control ends suspension which triggers a catchup event.

    {
    "type": "groupaction",
    "details": {
        "action": "catchup",
        "source": "system",
        "clientId": "66a1e2cd-a122-43df-9937-f8d481c7a317",
        "local": true,
        "seekTime": 9.72914
    }
    }
image

Also removed property blocked on ExtendedMediaSessionActionDetails