Apple’s LivePhoto Kit for JavaScript

Thomas Mak wrote at 2017-04-24.

#ios #javascript

Apple’s doc:

Code snippet:

<h1>Live Photo Demo</h1>

  <img src='' alt='Sample Live Photo in Macao Science Center.'>

<script src=''></script>

I modified Apple’s example code to include an img tag for accessibility reason.

Note: In my test, the code does not work in Safari and Safari Technical Preview in latest OS 10.12.4.

Note 2: Using CSS to set width and height won’t work. The JS replaces the entire element. So the size has to be inline.

Video preview

The video preview shows the importance to include the <img> tag inside the live-photo div.

Codepen Preview

See the Pen Apple Live Photo Demo by Thomas Seng Hin Mak (@makzan) on CodePen.


no comments yet.