Skip to content

Instantly share code, notes, and snippets.

@dglazkov
Forked from linjunpop/README.md
Created October 6, 2015 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dglazkov/31c57b6a2ed1fa14582d to your computer and use it in GitHub Desktop.
Save dglazkov/31c57b6a2ed1fa14582d to your computer and use it in GitHub Desktop.
iOS 7 Safari Notes

CSS font values

-apple-system-headline1
-apple-system-headline2
-apple-system-body
-apple-system-subheadline1
-apple-system-subheadline2
-apple-system-footnote
-apple-system-caption1
-apple-system-caption2
-apple-system-short-headline1
-apple-system-short-headline2
-apple-system-short-body
-apple-system-short-subheadline1
-apple-system-short-subheadline2
-apple-system-short-footnote
-apple-system-short-caption1
-apple-system-tall-body

iOS Airplay API

 <video id="video" src="my-video.mp4"></video>
 <div id="controls">
     <button id="playButton">Play</button>
     <button id="pauseButton" hidden>Pause</button>
     <button id="airPlayButton" hidden disabled>AirPlay</button>
</div>
if (window.WebKitPlaybackTargetAvailabilityEvent) {
    video.addEventListener('webkitplaybacktargetavailabilitychanged',
        function(event) {
            switch (event.availability) {
            case "available":
                airPlayButton.hidden = false;
                airPlayButton.disabled = false;
                break;
            case "not-available":
                airPlayButton.hidden = true;
                airPlayButton.disabled = true;
                break;
            }
        }
    );
}

if (!window.WebKitPlaybackTargetAvailabilityEvent)
    return;
var airPlayButton = document.getElementById("airPlayButton");
var video = document.getElementById("video");
airPlayButton.addEventListener('click', function(event) {
    video.webkitShowPlaybackTargetPicker();
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment