Playback Application For Mac



  1. Playback Application For Mac High Sierra
  2. Playback Application For Mac Catalina
ForPlayback application for mac catalina

The best way for you to learn AVKit and AVFoundation is to dive in and build your first playback app. This chapter shows you how to get started with these frameworks by walking you through the development of a basic app for iOS, tvOS, and macOS to play media served using HTTP Live Streaming. This project requires that you be familiar with developing apps for at least one of these platforms. For more information, see Start Developing iOS Apps (Swift) and Mac App Programming Guide. The example projects in this chapter are written in Swift 3 and require Xcode 8.0 or later.

iOS and tvOS

Download Colibri DAC DSD Test for macOS 10.10 or later and enjoy it on your Mac. ‎A simple app that enables you to try different DSD playback modes such as DoP, DoPA and PCM. Simply load a DSD/FLAC/WAVE file, select your audio device and hit one of the playback options. Besides Video File Playback, version 2.0 includes the following new features: – Fully redesigned user interface. The new modern user interface provides a better look and feel, and easier and faster access to all the settings. – Mirror any application window instead of the full screen.

Create a new Xcode project for an iOS or tvOS app using the Single View Application template.

  • Product Name: AVBasicPlayback

  • Language: Swift

  • Devices: Universal (iOS only)

Configuring the Project’s App Transport Security

Begin by configuring the project’s App Transport Security so your app can successfully connect to the remote server.

  1. In the project navigator, locate the app’s Info.plist file. Right-click this file and select Open As > Source Code.

  2. Add the following entry before the closing </dict> tag:

    Adding this entry ensures that the app can successfully retrieve the media served from devimages.apple.com.edgekey.net.

Setting up the Audio Session

Playback Application For Mac
  1. Open the AppDelegate.swift class. Above the class definition, import the AVFoundation framework.

  2. In the application:didFinishLaunchingWithOptions: method, set the app’s audio session category to AVAudioSessionCategoryPlayback.

    Setting the audio session category ensures that the application has the audio behavior expected of a media playback app.

Configuring the User Interface

  1. Select the Main.storyboard file. In the Object library’s search field, type button to find the Button object.

  2. Drag the Button object into the View Controller Scene’s view and give it the title Play Video.

  3. Add alignment constraints so the button is centered both horizontally and vertically.

Implementing the Playback Behavior

  1. In the project navigator, select the Main.storyboard file and open the assistant editor.

  2. Control-drag from the Play Video button to the ViewController.swift class to add a new @IBAction method called playVideo.

  3. Close the assistant editor and select the ViewController.swift class in the project navigator. Above the class definition, import the AVKit and AVFoundation frameworks.

  4. In the playVideo method, add the following implementation:

Your app is complete, and you can run it in the Simulator or on your iOS or tvOS device. In only a few lines of code, you’ve created a full-featured playback app.

macOS

Create a new Xcode project for a Cocoa app using the Cocoa Application template.

  • Product Name: AVBasicPlayback

  • Language: Swift

  • Use Storyboards: true

  • Create Document-Based Application: false

Configuring the Project’s App Transport Security

Begin by configuring the project’s App Transport Security so your app can successfully connect to the remote server.

Playback application for mac high sierra
  1. In the project navigator, locate the app’s Info.plist file. Right-click this file and select Open As > Source Code.

  2. Add the following entry before the closing </dict> tag:

    Adding this entry ensures that the app can successfully retrieve the media served from devimages.apple.com.edgekey.net.

Configuring the User Interface

  1. In the project navigator, select the Main.storyboard file. In the Object library’s search field, type player to find the AVKit Player View object.

  2. Drag the AVKit Player View object into the View Controller Scene’s view.

  3. Add pinning constraints to the player view to pin it to its superview’s edges and maintain its aspect ratio.

  4. Select the player view. In the Attributes inspector, change the Controls Style selection to Floating.

    This style presents controls matching the ones found in Quicktime Player.

Implementing the Playback Behavior

  1. While in the Main.storyboard file, open the assistant editor.

  2. Control-drag from the player view object to the ViewController.swift class and add a new @IBOutlet called playerView.

  3. Close the assistant editor and select the ViewController.swift class in the project navigator. Above the class definition, import the AVKit and AVFoundation frameworks.

  4. In the viewDidLoad method, add the following implementation:

Your app is complete, and you can run it. In only a few lines of code, you’ve created a full-featured playback app.


Macbook

Playback Application For Mac High Sierra


Playback Application For Mac Catalina

Copyright © 2018 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2018-01-16