Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8130575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:45:58+00:00 2026-06-06T08:45:58+00:00

I am developing an iOS app with a tab bar controller. In the first

  • 0

I am developing an iOS app with a tab bar controller. In the first tab, I placed an instance of AVQueuePlayer to start playing music from the web. I did all coding to allow play and pause events through remote control events. But I could able to receive remote control events only when I stay in the first tab. When I switch to other tabs, remote control events are not received to the first tab.

When I place the following lines in first tab view controller, I can receive remote control events to first tab even when I stay in second tab.

- (BOOL)canResignFirstResponder
{
    return NO;
}

But I have some text fields in other views with which the user has to interact. By not resigning first responder in first tab, I cannot input text in other tabs.

Please help me how can I handle remote control events to control an AVQueuePlayer instance in first tab while my user interacts with the app in second tab ?

Thanks for your help !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T08:46:00+00:00Added an answer on June 6, 2026 at 8:46 am

    OK. I figured it myself.

    I created a global variable for the avqueueplayer in the starting of the implementation file.
    Allocated and initiated the AVQueuePlayer in viewDidLoad method.
    Created a class method to handle what to do in the event of play and pause.
    And called this class method in other view controllers to handle the remote control events directly from those view controllers. Here is a sample of what I coded:

    //playerView header file
    
    @interface playerView : UIViewController
    
    + (void)togglePlayPause;
    
    @end
    
    //playerView Implementation File
    
    #import "playerView.h"
    
    @interface playerView ()
    @end
    
    @implementation playerView
    
    AVQueuePlayer *player;
    
    - (void)viewDidLoad
    {
    [super viewDidLoad];
    player = [[AVQueuePlayer alloc] initWithPlayerItem:[AVPlayerItem playerItemWithURL: someurl]];
    }
    
    + (void) togglePlayPause
    {
        if (player.rate == 1.0)
        {
            [player pause];
        }
        else if ((player.rate == 0.0) && ([player status]!= 2))
        {
            [player play];
        }
    }
    
    // include all other methods to handle remote control events as laid in apple documentation
    
    @end
    
    
    
    //otherView Implementation file
    
    #include "playerView.h"
    
    
    @interface otherView ()
    
    @end
    
    @implementation otherView
    
    // include all other methods to handle remote control events as laid in apple documentation
    
    - (void) remoteControlReceivedWithEvent: (UIEvent *) receivedEvent
    {
    
        if (receivedEvent.type == UIEventTypeRemoteControl) {
    
            switch (receivedEvent.subtype) {
                case UIEventSubtypeRemoteControlTogglePlayPause:
                    [playerView togglePlayPause];
                    break;
                default:
                    break;
            }
        }
    }
    
    @end
    

    For all other methods to handle remote control events as laid in apple documentation refer to:

    Event Handling Guide for iOS – Remote Control of Multimedia

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing web-application (and also native iOS app) that uses images from different websites.
I'm developing an iOS app. I get collection of images from web, store them
I'm developing a first iPhone app for iOS 4.x/5.0 and have some confusions on
I'm developing an iOS app with a UIWebView instance. If the user touches an
We developing a iOS app that uses CoreData. To keep ourselves from going crazy
I am a real n00b in developing iOS app. This is my first application
I am developing an iOS app with Core Data. The app grabs data from
I am developing an iOS app where I am recording sound from the devices
I've begun developing my first iOS app with Xcode 4.2, and was targeting iOS
I am about to start designing/developing a client-server iOS app. I am leaning towards

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.