One Logo Pool Ball
GroupActivities · IOS API REFERENCE

GroupSessionEvent.Action

struct · iOS 15.0+ · SDK 27.1

struct Action

A playback-related change that occurs during the session. Use this structure to communicate playback-related changes to participants using the system UI. You can use this structure to communicate the following types of events: * Transport-related events for a custom player. * Changes to a playback queue your app manages. When a change occurs in your custom player or playback queue, create an instance of this structure to describe the change and wrap it in a ``GroupSessionEvent`` structure. To display the event to the participant call the ``GroupSession/showNotice(_:)`` method of the session. The system formats and displays the information you provide. - Note: If your app uses AV Foundation to play content, you don't need to communicate transport-related events yourself. AV Foundation generates appropriate events when the user plays, pauses, seeks, or skips tracks.

Members (6)

get

updatedQueue

TypeScript
static get updatedQueue(): GroupSessionEvent_Action
Swift declaration
static let updatedQueue: GroupSessionEvent.Action

An action that represents a nonspecific change to the queue. Use this action when the other action types don't accurately describe the change you made to the queue. If you can specify the change using a ``QueueChange`` type, use the ``GroupSessionEvent/Action-swift.struct/updatedQueue(_:)`` method instead.

static

updatedQueue

TypeScript
static updatedQueue9711(change: GroupSessionEvent_Action_QueueChange): GroupSessionEvent_Action
Swift declaration
static func updatedQueue(_ change: GroupSessionEvent.Action.QueueChange) -> GroupSessionEvent.Action

Returns an action that represents a change to the playback queue. When you want to notify the user of changes to the playback queue, call this method to create an action type with the details of the change. Then call the ``GroupSession/showNotice(_:)`` method to post that action. For example, use the following code to notify the user that someone added a song to the queue. ``` groupSession.showNotice(.updatedQueue(.added(.song("Here comes the sun")))) ``` - Parameters: - change: The change that ocurred to the queue.

get · iOS 15.0+

play

TypeScript
static get play(): GroupSessionEvent_Action
Swift declaration
static let play: GroupSessionEvent.Action

An action that indicates the start of playback.

get · iOS 15.0+

seek

TypeScript
static get seek(): GroupSessionEvent_Action
Swift declaration
static let seek: GroupSessionEvent.Action

An event that indicates a change to the current playback location.

static · iOS 15.0+

skip

TypeScript
static skip(item: string): GroupSessionEvent_Action
Swift declaration
static func skip(item: String) -> GroupSessionEvent.Action

Returns an event that indicates a skipped track or playback item. This function creates an action that represents a skipped playback item. If your app's activity manages a playlist of items, you might use this action to indicate a participant skipped an item. For example, you might name a skipped song in a shared playlist. - Parameters: - item: The name of the skipped item.

get · iOS 15.0+

pause

TypeScript
static get pause(): GroupSessionEvent_Action
Swift declaration
static let pause: GroupSessionEvent.Action

An action that indicates an end to playback.

Skipped declarations

No declarations were skipped in this snapshot.

All GroupActivities types →