Custom Airplay button with cocoalibspotify - cocoalibspotify-2.0

I'm using SPPlaybackManager and i saw that there is support in Airplay , but i can't find any function that activate the airplay , the only support i see is when i press the home button twice swiping right till i see the airplay button.
is there any way i could make an custom button on my view that when i press on it it will pop up all the NEAR-BY devices using cocoalibspotify?
i saw it is possible with MPVolumeView... but nothing with spotify.
will appreciate if any of you fellows could direct me a bit cause i try to search and didn't found nothing about this subject.
Thanks in advance

MPVolumeView is the thing to use - the AirPlay setting is system-wide. As such, there's nothing in CocoaLibSpotify specifically to do with AirPlay.

Related

Titanium: Airplay button for custom video player

I have built a custom video player in Titanium. Everything works on it currently, however, I need to implement the AirPlay button back in. Using native objective-c, I see it is possible to do this using a the MPVolumeView according to this thread: AirPlay button on custom view
That is great, if I was coding in objective-c, but that isn't the case. Does anyone have any idea how I can implement this feature through titanium?

iPad application - Mirroring the app in airplay

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.

Preventing the volume HUD from appearing with MPMusicPlayerController, is it acceptable?

My issue is the HUD that accompanies a change in the MPMusicPlayerController's volume property. Whilst there is a solution, I want to know if it is acceptable by Apple to hide the MPVolumeView to prevent the HUD from showing?
And on another note, if I choose not to use the MPVolumeView class, will the user still have the option to play audio from the app on an AirPlay device via the multi-tasking bar?
Submitted my app and it was acceptable. It seems that it is OK with Apple to use the described method.

How to figure out when a HTML5 video player enters the full screen mode on iOS / iPads?

The HTML5 <video> tag offers the user a button to toggle on and off the fullscreen mode on Safari for mobile devices (iOS).
I would like to capture and handle this user action but it doesn't seem to raise an event when the button is pressed and the player enters the full screen mode.
Here is the link to the Safari API for the HTMLVideoElement class:
https://developer.apple.com/documentation/webkitjs/htmlvideoelement
We can easily find out when the video is paused of played in Javascript, like this:
function onload()
{
var player = document.getElementsByTagName("video")[0];
player.addEventListener('play',videoPlayHandler,false);
player.addEventListener('pause',videoPauseHandler,false);
}
However they don't seem to have any events for when the video enters the full screen mode.
We can force the video into fullscreen mode in response to user action by calling the webkitEnterFullscreen(), but that doesn't help me. I need to know when the user taps on the fullscreen button.
Hiding the controls and replacing them by my own custom controls sounds like a really long winded solution.
Another option I can think of is to set a timing event, constantly checking for the webkitDisplayingFullscreen property, but that feels like a bad thing to do in terms of memory management.
Can anyone suggest a better solution?
After much faffing around a friend finally pointed me in the right direction.
The events I was looking for are: webkitbeginfullscreen and webkitendfullscreen
var player = document.getElementsByTagName("video")[0];
player.addEventListener('webkitbeginfullscreen', onVideoBeginsFullScreen, false);
player.addEventListener('webkitendfullscreen', onVideoEndsFullScreen, false);
With that I can safely capture when the user clicks over the fullscreen button on Safari for the iPads. Interestingly the same events don't seem to work for Safari on the iMac (tested on version 5.1.2).
Thanks Apple for their inconsistency and hours of wasted time.

Set Airplay manually?

I have an iPad app and I have a video playing in a view. I would like to play video using Airplay but by pressing my own button.
I have set allows airplay = YES and so forth, this works if I enable the full controls, but I want to set no controls and have my own button to play the video using Airplay.
So far, I have found no information that would allow me to play a video on AppleTV without allowing the normal controls.
So just using an UIButton action to force the airplay, or at least get available devices and set it manually. Anything that would allow me to do this.
MPVolumeView will only control audio, it won't control video. For that you'd need iOS 5's AVPlayer, or a movie controller.
An alternative for you might be to use AirplayKit, a 3rd party library.
https://github.com/rothacr/AirplayKit
To answer my own question.
This is quite possible without jailbreak.
Here is apple's own page explaining this, so this will pass the review process.
Apple developer library document explaining how to do this

Resources