A macOS-only object that displays the video content from a player object along with system-supplied playback controls.
SDK
- macOS 10.9+
Framework
- AVKit
Declaration
@interface AVPlayerView : NSView
Overview
The player view supports a variety of different controls styles, ranging from no controls at all to controls matching the look of QuickTime Player. This makes it easy for you to tailor the presentation to best match your use of the player view. Regardless of the selected controls style, the player view always supports a standard set of keyboard shortcuts to control playback:
The spacebar plays and pauses playback.
The right and left arrow keys step frame-by-frame through the video.
JKL Navigation:
The J key rewinds. You can press it multiple times to cycle through rewind speeds.
The K key stops playback.
The L key fast-forwards. You can press it multiple times to cycle through fast-forward speeds.
In addition to providing the core playback interface for your media applications, AVPlayer
also makes it easy to add trimming capabilities to your player. Invoking the player view’s begin
method presents a trimming interface like that of QuickTime Player making it easy to trim the media to the desired time range.
AVPlayer
is built with modern applications in mind and automatically supports all of the standard modern macOS features, such a localization, state restoration, full-screen playback, high-resolution display, and accessibility.