Questions tagged [airplay]

Airplay is a streaming technology made by Apple to stream media to multiple devices wirelessly or to the Airplay SDK that offers deployment to many platforms.

Airplay?

Airplay is a Streaming Technology made by Apple Inc to stream media to multiple devices wirelessly or to the Airplay SDK that offers deployment to many platforms including iOS, macOS, tvOS, watchOS, Windows, Linux, Android, Symbian, and more recently, through the Airplay Arcade, all major consoles and handheld devices.


Apple added Airplay in Safari

In 2015 Apple added Airplay for HTML5 Video *default player, And a API for JavaScript Presentation mode, for those who wanna use their own video player.

This can be done by using the following code:

// Safari 9+
if (window.WebKitPlaybackTargetAvailabilityEvent) {
    video.addEventListener('webkitplaybacktargetavailabilitychanged', function(event) {
        switch (event.availability) {
            case "available":
                airPlay.style.display = 'block';
                break;
            default:
                airPlay.style.display = 'none';
        }
        airPlay.addEventListener('click', function() {
            video.webkitShowPlaybackTargetPicker();
        });
    });
}

NOTE: Airplay can be use for both Audio and Video.


In 2016 They added Picture In Picture to the default HTML5 Player, its also use Javascript Presentation mode API.

453 questions
6
votes
2 answers

Swift AVPlayerViewController Add AirPlay

I'm attempting to enable AirPlay with my AVPlayerViewController. In the document: https://developer.apple.com/reference/avkit/avplayerviewcontroller It states AVPlayerViewController automatically supports AirPlay, but you need to perform some…
Mike Walker
  • 2,944
  • 8
  • 30
  • 62
6
votes
2 answers

iOS Airplay - "Playing on your TV"

I have displayed the airplay button using this code var airplayButton: UIBarButtonItem! let airView: MPVolumeView = MPVolumeView() airView.showsRouteButton = true airView.showsVolumeSlider = false airView.sizeToFit() airView.tintColor =…
Taimur Ajmal
  • 2,778
  • 6
  • 39
  • 57
6
votes
1 answer

AVPlayer not working with AirPlay

I have a sequence of AVMutableCompositions that I am playing with AVPlayer. Everything works great when I am playing via speaker, headphones, or bluetooth. However, as soon as I connect to AirPlay, everything falls apart. I can play one asset, and…
6
votes
0 answers

iOS: Is there a way to programmatically reset AirPlay back to the iPad?

I have an iOS app that plays video using the AVPlayer, and I want to enable AirPlay. Using information from here:…
6
votes
0 answers

UIEvents sent from Apple TV while using AVPlayer external playback mode

I have an app that displays videos, and it's very important to us that we intercept all pause events, and prevent users from seeking in videos. Doing it on device is pretty simple, we just don't expose any 'regular' controls to user, and in…
Jan Klausa
  • 61
  • 2
6
votes
3 answers

iOS AirPlay Second Screen Tutorial

I am looking at adding AirPlay capabilities to one of my ViewControllers. The View Controller just shows a UIWebView. What I want to do is add a button that will mirror this content to an Apple TV. I know system-wide mirroring can be done, but it…
user717452
  • 33
  • 14
  • 73
  • 149
6
votes
0 answers

How to add in-app airplay control on OS X

I would like to add airplay control in my application on OS X and play a video on Apple TV, without using the airplay mirroring feature. The behaviour should be similar to the video player on iOS. On iOS, you can do this via the "MPVolumeView",…
6
votes
0 answers

How can I make Android apps that work with Apple Airplay?

I've read an article about Apple Airplay, and I've searched some apps like Air bubble, but still I have some questions: Is it OK to make Airplay apps for non-iOS? Is there a license problem? Does Apple's MFI program (or developer license) cover…
Zigfreid
  • 121
  • 3
  • 8
6
votes
2 answers

Is there a way to keep Airplay running if the device auto-sleeps/auto-locks?

When streaming a video from an iPhone (or any iOS device) to a TV via Airplay, the stream stops as soon as the device goes to sleep from inactivity. At the moment, I disabled the sleep timer so that the device does not automatically sleep, but is…
aeonsamurai
  • 69
  • 1
  • 1
  • 2
6
votes
2 answers

AVComposition breaks on Airplay

I have a video composition which I'd like to play over Airplay (without mirroring). The app works as expected when using normal Airplay mirroring, but I'd like to get the speed, reliability, and resolution bump you get from using Airplay video…
mrgrieves
  • 567
  • 5
  • 19
6
votes
1 answer

Airplaying video from url to ATV using lots of battery on iphone

I am writing an app that plays a url using MPMoviePlayerController. The app works in the background and using airplay also works with an ATV, macmini using airserver and XBMC. The url is to a movie file on the local network. The way I understand…
Ajaxharg
  • 2,974
  • 2
  • 18
  • 19
6
votes
1 answer

How to find the IP-address of the active AirPlay device?

I am wondering if it´s possible to get the IP address of the airplay device my iOS app is currently using. Either that, or the IP-addresses of all airplay capable devices on the network. Thank you in advance! EDIT: Although I now have an accepted…
Nailer
  • 2,446
  • 1
  • 24
  • 34
5
votes
2 answers

Airplay of audio using AVPlayer does not work in the background

I am doing audio playback using the AVPlayer class from a remote URL. It plays fine if I just play to the headphones/built in speaker, but I am seeing some oddities with AirPlay. When I change to use an AppleTV for AirPlay, it will stream the audio,…
Andrew Kuklewicz
  • 10,621
  • 1
  • 34
  • 42
5
votes
2 answers

Javascript: Airplay in the browser

Is there a way to send images, videos, and audio to an AirPlay server using JavaScript in the browser?
themirror
  • 9,963
  • 7
  • 46
  • 79
5
votes
1 answer

Trying to cast a local video file using AirPlay returns 'externalPlaybackNotSupportedForAsset' (-11870)

I'm currently having some troubles using AVPlayer and AVAsset in order to cast a video to an external screen using AirPlay. After adding the AVRoutePickerView in order to have the AirPlay button, I was able to successfully cast videos to use…
Alessandro Sperotti
  • 183
  • 1
  • 1
  • 12