Skip to content

Commit f4d5428

Browse files
authored
Merge pull request #93 from tumblr/stories/16-8-fixes
Stories bug fixes for 16.8 release
2 parents 0bdd05a + 1f5aaf3 commit f4d5428

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

Classes/Camera/CameraController.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,8 @@ open class CameraController: UIViewController, MediaClipsEditorDelegate, CameraP
365365
private func createNextStepViewController(_ segments: [CameraSegment], selected: Array<CameraSegment>.Index, edits: [EditorViewController.Edit?]?) -> MediaPlayerController {
366366
let controller: MediaPlayerController
367367
if settings.features.multipleExports && settings.features.editor {
368-
if segments.indices.contains(selected) {
369-
multiEditorViewController?.addSegment(segments[selected])
368+
segments.forEach { segment in
369+
multiEditorViewController?.addSegment(segment)
370370
}
371371
controller = multiEditorViewController ?? createStoryViewController(segments, selected: selected, edits: edits)
372372
multiEditorViewController = controller as? MultiEditorViewController

Classes/Rendering/MediaPlayer.swift

+5
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,11 @@ final class MediaPlayer {
205205
init(renderer: Rendering?) {
206206
self.renderer = renderer ?? Renderer()
207207
self.renderer.delegate = self
208+
do {
209+
try AVAudioSession.sharedInstance().setCategory(.playback, mode: .default)
210+
} catch let error {
211+
print("Failed to set audio session category: \(error)")
212+
}
208213
}
209214

210215
deinit {

Classes/Utility/Device.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ public struct KanvasDevice {
2020
static let iPhone11ScreenHeight = 896
2121
static let iPhone11ProScreenHeight = 812
2222
static let iPhone11ProMaxScreenHeight = 896
23+
static let iPhone12ProScreenHeight = 844
24+
static let iPhone12ProMaxScreenHeight = 926
2325
static let retinaScreenMinScale: CGFloat = 2.0
2426

2527
// Device type
@@ -44,8 +46,10 @@ public struct KanvasDevice {
4446
static let isIPhone11: Bool = isIPhone && screenMaxLength == iPhone11ScreenHeight
4547
static let isIPhone11Pro: Bool = isIPhone && screenMaxLength == iPhone11ProScreenHeight
4648
static let isIPhone11ProMax: Bool = isIPhone && screenMaxLength == iPhone11ProMaxScreenHeight
49+
static let isIPhone12Pro: Bool = isIPhone && screenMaxLength == iPhone12ProScreenHeight
50+
static let isIPhone12ProMax: Bool = isIPhone && screenMaxLength == iPhone12ProMaxScreenHeight
4751

4852
// Device group
4953
// This group represents all devices which have extra safe space at the top and the bottom, as well as rounded screen corners.
50-
public static let belongsToIPhoneXGroup: Bool = isIPhoneX || isIPhoneXR || isIPhoneXS || isIPhoneXSMax || isIPhone11 || isIPhone11Pro || isIPhone11ProMax
54+
public static let belongsToIPhoneXGroup: Bool = isIPhoneX || isIPhoneXR || isIPhoneXS || isIPhoneXSMax || isIPhone11 || isIPhone11Pro || isIPhone11ProMax || isIPhone12Pro || isIPhone12ProMax
5155
}

Kanvas.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |spec|
22
spec.name = "Kanvas"
3-
spec.version = "1.2.2"
3+
spec.version = "1.2.3"
44
spec.summary = "A custom camera built for iOS."
55
spec.homepage = "https://github.com/tumblr/kanvas-ios"
66
spec.license = "MPLv2"

0 commit comments

Comments
 (0)