My app uses AVQueuePlayer to show video clips back to back. In testing on my AppleTV, it seems that when I switch to the next video in the queue, there is a small time gap where the Apple TV 'takes over' the screen and the home screen of the Apple TV is displayed. Is there any way to prevent this gap from happening, even a black screen or loading indicator would be a better experience.
I was having this exact same problem and was dismayed when I saw that no one had yet to find an answer.
The solution I ended up going with involved taking advantage of the multiple display support added in iOS 5. There are some helpful links in learning how to do this here:
https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/WindowAndScreenGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40012555-CH1-SW1
http://blog.redfin.com/devblog/2012/05/creating_a_dual-screen_airplay_experience_for_ios_and_apple_tv.html#.UjCe5mRATZY
The app I am designing will basically look for the availability of an external screen. If it finds one it will play the videos on the viewcontroller I provide for that external screen. That viewcontroller can have a black background so that any pause in between videos looks natural and no longer has the Apple TV home screen pop into view for a moment.
Related
I am developing a music app that plays audio, regular video (such as mp4) and youtube videos. It has the proper background mode enabled, as the app plays audio and regular video correctly in the background.
The following issue appears only on the iPad, not on the iPhone.
Using the YouTube-Player-iOS-Helper on iOS 8, adding the youtube video content (YTPlayerView) to another view (as a subview) works great, even when playing. However, removing that YTPlayerView from its superview automatically pauses the playback, which isn't always the desired case (sending the app to the background causes the same effect).
Is it possible to change that behaviour?
I can rationalize manually resuming the playback when the app goes to the background, however, doing the same for the 'remove from superview scenario' causes the playback to stutter for a moment.
The issue can easily be reproduced with the sample app for 'YouTube-Player-iOS-Helper', by playing a video and then changing between tabs. On the iPhone, the player does NOT pause, but on the iPad, the player DOES pause.
If it's impossible, is there other Youtube SDKs that allow this behaviour and still adhere to the official terms and conditions?
Thanks
Figured this one.
The YTPlayerView will NOT pause, on iPad or iPhone, if you remove it from its superview and immediately add it to a view again (can be a different view). That view must be inside a view controller properly rooted in the view hierarchy (not detached).
I have followed the many helpful previous questions to get my AVPlayer successfully streaming video when my app goes to the background. There are two methods described on Apple's QA1668 and they both work for my stream urls.
The problem is that there is a noticeable audio gap during the transition that is identical for both methods. On my iPhone 6 in release mode I would say the gap is less than 0.5 seconds, which may not seem terrible but if I'm playing something like a music video this is very distracting.
After more testing it looks like this gap actually occurs when I remove the AVPlayerLayer (or, if I am using the other method, when I disable the AVMediaCharacteristicVisual tracks) as I have determined it will still happen if I hook those actions up to a button rather than the backgrounding state.
My guess is that is has something to do with the audio re-syncing to the new video state of the AVPlayer but really I have no clue. Any help would be greatly appreciated!
Is it possible to create an application for BBOS10 that shares screen to other phone/PC on wifi network just like Radmin on Windows?
I presume you are talking about sharing the screen regardless of content, rather than sharing the screen for a specific application that you have written.
I am not aware of any "API"s for doing this.
This leaves, I believe two options, which are loosely:
capture screen shots and forward these
capture a video of the screen and forward that
Now the screen shot API has been available since fairly early on in BB10 evolution. To use it you would just create a background Thread and take screen shots at regular intervals, which you would then send, presumably over a socket interface, to the receiving user. I suspect The biggest issue with this is that it is likely to be extremely data heavy, since the screen shots are complete images, as opposed to a streaming video which is (in my understanding) typically a series of diffs from the preceding frame.
Until very recently, it has not been possible to capture video of the BB screen, but it seems with 10.2, you now can. Please review this Thread:
Capture Video
on the BB10 forum.
Looking at this, it would appear you can capture each video frame and forward that, or presumably, capture the entire stream and forward that.
I have a music player app which implements background audio. I’m trying to update the screenshot in the iOS7 multi-tasking switcher when the track changes. So, if I background the app during Song A, it finishes and Song B comes on, if I then go into the tray I’d like to see a screenshot showing Song B’s artwork, title, etc.
I’ve done some digging and not managed to find any way to tell iOS to update short of implementing Background Fetch and going all out with that. Is there another means of doing this, something I can call to tell it to refresh it when my tracks change?
Apple does not provide any means of doing this. Even iOS own media player does not have this ability.
I've a kids application which is rich in graphics.
It don't have any videos in it. Only background audio will be there
It has some activities like counting numbers, reading alphabets etc.
Can I mirror the application in apple tv using airplay so that what ever they see on iPad app must be shown on TV also?
I googled a lot... but i couldn't find any code. But I read that its possible. Can some one guide in how to proceed with this feature?
To use AirPlay your application does not necessarily have to do anything special. AirPlay is built-into iOS, and any app or game can take advantage of it. The user simply has to double-tap the Home button, swipe to the left, press the AirPlay button and select the mirroring option. This works for all apps automatically, including video and sound.