Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

AVF context unavailable nothing happening  #57

@Ajack123

Description

@Ajack123

Hi there jpsim
While searching the Internet for a volume button handler I stumbled upon your code here.
I really need your code and tried to run it in Xcode but during simulation I get the following message:

2018-04-01 11:11:11.082845-0700 Buttons[11228:255620] [MediaRemote] [AVOutputContext] WARNING: AVF context unavailable for sharedAudioPresentationContext
2018-04-01 11:11:11.087537-0700 Buttons[11228:255620] [MediaRemote] [AVOutputContext] WARNING: AVF context unavailable for +[MRAVOutputContext createOutputContextWithUniqueIdentifier:]

I have to admit that I really do not know objective c but I was pretty sure that I did everything you've said.I've added the frameworks in my settings,too

#import "helloViewController.h"
#import <AVFoundation/AVFoundation.h>
#import <MediaPlayer/MediaPlayer.h>
#import "SystemVolumeView.h"

#import "JPSVolumeButtonHandler.h" //here importer

@interface helloViewController ()

@Property (nonatomic,strong) JPSVolumeButtonHandler *volumeButtonHandler;// declared

@EnD

@implementation helloViewController

  • (void)viewDidLoad {
    [super viewDidLoad];

    [self.volumeButtonHandler stopHandler]; // just to make sure but also tried without this line
    [self.volumeButtonHandler startHandler:YES];

}

  • (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
    }

  • (IBAction)showMessage //click button to see if it works then it should listen for button press
    {
    NSLog(@"Something");
    self.volumeButtonHandler = [JPSVolumeButtonHandler volumeButtonHandlerWithUpBlock:^{
    // Volume Up Button Pressed
    NSLog(@"Volume Up Button Pressed");

    } downBlock:^{
    // Volume Down Button Pressed
    NSLog(@"Volume Down Button Pressed");

    }];}

your code is very crucial for me. I've already implemented this feature for my android app version but I'm struggling with iOS. All other objective c codes on the internet are outdated. they worked until iOS 7.

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions