Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document PillarboxPlayer APIs as supported on the main thread only #932

Merged
merged 2 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Sources/Player/Player.docc/PillarboxPlayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Create engaging audio and video playback experiences.

## Overview

> Warning: PillarboxPlayer APIs are currently meant to be used from the main thread only. Calling APIs from background threads is not supported and leads to undefined behavior.

The PillarboxPlayer framework provides a complete toolbox to add advanced audiovisual media capabilities to your app.

Play content easily with a ``Player`` and display its content in the standard AVKit user interface with ``SystemVideoView``, or build an entirely custom user interface starting from a simple ``VideoView``. Play any kind of content from any source by implementing your own ``PlayerItem``s and ``Asset``s, no matter where your content comes from or how it must be played. Track playback with your own ``PlayerItemTracker``, whether for analytics purposes or Quality of Service (QoS) data collection.
Expand Down
2 changes: 2 additions & 0 deletions Sources/Player/Tracking/CurrentTracker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ final class CurrentTracker {
item.enableTrackers(for: player)

player.propertiesPublisher
.receiveOnMainThread()
.sink { properties in
item.updateTrackerProperties(properties)
}
.store(in: &cancellables)

item.metricLog.eventPublisher()
.receiveOnMainThread()
.sink { event in
item.receiveMetricEvent(event)
}
Expand Down