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

IDSK-2547 Re-writing AVPlayerExample #406

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
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
258 changes: 148 additions & 110 deletions AVPlayerExample.xcodeproj/project.pbxproj
100644 → 100755

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion AVPlayerExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
100644 → 100755

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
16 changes: 0 additions & 16 deletions AVPlayerExample/AVPlayerView.h

This file was deleted.

30 changes: 0 additions & 30 deletions AVPlayerExample/AVPlayerView.m

This file was deleted.

15 changes: 0 additions & 15 deletions AVPlayerExample/AppDelegate.h

This file was deleted.

44 changes: 0 additions & 44 deletions AVPlayerExample/AppDelegate.m

This file was deleted.

59 changes: 59 additions & 0 deletions AVPlayerExample/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
//
// AppDelegate.swift
// AVPlayerExample
//
// Copyright © 2018 Twilio Inc. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
print("didFinishLaunchingWithOptions:", launchOptions as Any)
if let options = launchOptions,
let videoUrl = options[UIApplication.LaunchOptionsKey.url] as? URL {
let rootVC = window?.rootViewController as! ViewController
rootVC.connect(contentUrl: videoUrl)
}
return true
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Lets use Twilio's video
  2. Do not launch with URL, remove plist entry.


func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
print("app:openURL:", url, " options:", options as Any)

let rootVC = window?.rootViewController as! ViewController
rootVC.connect(contentUrl: url)

return true
}

func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}

func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}


}

5 changes: 5 additions & 0 deletions AVPlayerExample/Assets.xcassets/AppIcon.appiconset/Contents.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
Expand Down
6 changes: 6 additions & 0 deletions AVPlayerExample/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
8 changes: 8 additions & 0 deletions AVPlayerExample/AudioDevices/AudioDevices-Bridging-Header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// AudioDevices-Bridging-Header.h
// AVPlayerExample
//
// Copyright © 2018 Twilio Inc. All rights reserved.
//

#import "ExampleAVPlayerAudioDevice.h"
29 changes: 29 additions & 0 deletions AVPlayerExample/AudioDevices/ExampleAVPlayerAudioDevice.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// ExampleAVPlayerAudioDevice.h
// AVPlayerExample
//
// Copyright © 2018 Twilio, Inc. All rights reserved.
//

#import <TwilioVideo/TwilioVideo.h>

/*
* ExampleAVPlayerAudioDevice uses a VoiceProcessingIO audio unit to play audio from an MTAudioProcessingTap
* attached to an AVPlayerItem. The AVPlayer audio is mixed with Room audio provided by Twilio.
* The microphone input, and MTAudioProcessingTap output are mixed into a single recorded stream.
*/
@interface ExampleAVPlayerAudioDevice : NSObject <TVIAudioDevice>

- (void)audioTapDidPrepare;

- (void)startAudioTapAtTime:(CMTime)startTime;

/*
* Creates a processing tap bound to the device instance.
*
* @return An `MTAudioProcessingTap`, or NULL if there is an error. The caller assumes all ownership
* of the tap, and should call CFRelease when they are finished with it.
*/
- (nullable MTAudioProcessingTapRef)createProcessingTap;

@end
Loading