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.