プロジェクト
GitHubで見る
LimitPoint/LivePhoto
概要
Apple Live Photosを扱うための、単一ファイルのライブラリです。
デザイン・メディア計測したスター増加
- 24時間
- 0
- 7日間
- 0
- 15日間
- 0
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナル![]()
LivePhoto.swift
A single-file helper library to work with Apple Live Photos
A Live Photo is a paired camera photo ("key photo") and video recording ("paired video"). Learn more about Live Photos from our in-depth blog post.
Live Photo format
A Live Photo consists of two resources paired using an asset identifier (a UUID string):
- JPEG image with special metadata for
kCGImagePropertyMakerAppleDictionarywith[17 : assetIdentifier] - Quicktime MOV with
- Quicktime metadata for
["com.apple.quicktime.content.identifier" : assetIdentifier] - Timed metadata track with
["com.apple.quicktime.still-image-time" : 0xFF]. This lets the system know where the still image sits in the movie timeline.
- Quicktime metadata for
LivePhoto.swift
The entire library is contained in the LivePhoto.swift file:
Extracting Resources from PHLivePhoto
LivePhoto.extractResources(from: livePhoto, completion: resources -> Void) {
let pairedImageURL = resources.pairedImageURL
let pairedVideoURL = resources.pairedVideoURL
}
Generating a Live Photo & Saving it to the Photo Library
LivePhoto.generate(from: photoURL, videoURL: videoURL, progress: { percent in }, completion: { livePhoto, resources in
// Display the Live Photo in a PHLivePhotoView
livePhotoView.livePhoto = livePhoto
// Or save the resources to the Photo library
LivePhoto.saveToLibrary(resources)
})
関連プロジェクトを探す
読み込み中…