GithubHelp home page GithubHelp logo

tapharmonic / learning-av-foundation Goto Github PK

View Code? Open in Web Editor NEW
1.0K 1.0K 372.0 78.95 MB

Sample code for Bob McCune's Learning AV Foundation book.

Home Page: http://learningavfoundation.com

License: MIT License

Objective-C 99.79% GLSL 0.13% Roff 0.07%

learning-av-foundation's Introduction

Learning AV Foundation

Book Cover

Sample code for Bob McCune's Learning AV Foundation book. The book is now available from from InformIT. Use MCCUNE1808 for a 30% discount!

You can find a more detailed overview of the book contents at Bob McCune's website: http://bobmccune.com/.

What about Swift?

One of the biggest questions I get about the book is when will there be a Swift version? Although a second edition of the book is planned, no specific date has yet been set for its release. However, I have started porting the book's sample code to Swift 4.2. If you want to follow along, the repo can be found here:

https://github.com/tapharmonic/Learning-AV-Foundation-Swift

learning-av-foundation's People

Contributors

bobmccune avatar slgraff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

learning-av-foundation's Issues

Chapter 2 AudioLooper_Starter

when I use
[nsnc addObserver:self selector:@selector(handleInterruption:) name:AVAudioSessionInterruptionNotification object:[AVAudioSession sharedInstance]];

else { //AVAudioSessionInterruptionTypeEnd AVAudioSessionInterruptionOptions options = [info[AVAudioSessionInterruptionOptionKey] unsignedIntegerValue]; if (options == AVAudioSessionInterruptionOptionShouldResume) { [self play]; if (self.delegate) { [self.delegate playbackBegan]; } }

music not playback to play tell me why [email protected]

AudioLooper_Starter info.plist already includes background modes

Chapter 2 contains the following passage:

With the audio session properly configured, redeploy the app to your device and run the tests again. You can hear that toggling the Ring/Silent switch no longer mutes the audio. This behavior looks good, so let’s verify that your audio continues to play when you lock the device. If you hit the Lock button, you can hear the audio continues to... Houston, we have a problem. You’re still seeing the same behavior as before. Shouldn’t you have solved this issue by setting the category to AVAudioSessionCategoryPlayback? The answer is no. Setting this category makes the app eligible to play audio in the background, which is the state we’re in when the device locks, but you still need to explicitly opt in to that behavior by making a small change to the application’s Info.plist.

then continues to describe how to add the relevant background mode to the app's plist. However, the starter already has the background mode added, so the passage and explanation can confuse readers.

Chapter 2 Code Error

in chapter 2, we should set Session Category in '- (void)applicationWillResignActive:(UIApplication *)application',not '- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions' .
like this :

  • (void)applicationWillResignActive:(UIApplication *)application {
    AVAudioSession *session=[AVAudioSession sharedInstance];
    [session setActive:YES error:nil];
    [session setCategory:AVAudioSessionCategoryPlayback error:nil];
    }

KameraWriter_Final

In KameraWriter_Final I found
self.captureSession.sessionPreset = [self sessionPreset];

did in fact not take effect, where as
[self.captureSession setSessionPreset:AVCaptureSessionPresetInputPriority];

did. Not sure why the return value didn't work, maybe missing const?

Also, it is worth adding support for check for

if(![videoDevice supportsAVCaptureSessionPreset:AVCaptureSessionPreset1280x720]){
 NSDictionary *userInfo = @{NSLocalizedDescriptionKey : @"Camera does not support session preset"};
        *error = [NSError errorWithDomain:THCameraErrorDomain
                                     code:THCameraErrorFailedToAddInput
                                 userInfo:userInfo];
        return NO;
}

as the front camera on an iPad2 for instance fails without throwing an error.

ZoomKamera_Starter launches to black screen, Error: (null)

After completing the code changes to ZoomKamera_Starter from Listing 7.2 and running the resulting app I find that the app will build, then run on my iPhone 6 but only displays a black screen. A few seconds later Xcode will display the error 'ZoomKamera [356:21199] Error: (null)' I reviewed the code I entered to ensure that it was accurate. Various troubleshooting measures (cleaning project, deleted app on iPhone, restarting iPhone, restarting Xcode) did not resolve issue. It's also reproducible when running project in second user account on Mac. Also occurs when running ZoomKamera_Starter without making any changes.

ZoomKamera_Final runs fine however.

This is on a MacBook Pro (mid-2012) running OS X 10.12.1 Sierra and Xcode 8.1 (8T61a).

KameraWriter_Final

When i receive a call the display freezes is there a way i can stop this from happening

KameraWriter_Final

You see for the camera writer
Would the tap to focus for the tapped screen point work for this as they refer to the preview layer if i am not mistaken.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.