Skip to content

Commit

Permalink
Merge pull request #93 from tumblr/stories/16-8-fixes
Browse files Browse the repository at this point in the history
Stories bug fixes for 16.8 release
  • Loading branch information
bjtitus authored Mar 2, 2021
2 parents 0bdd05a + 1f5aaf3 commit f4d5428
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Classes/Camera/CameraController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ open class CameraController: UIViewController, MediaClipsEditorDelegate, CameraP
private func createNextStepViewController(_ segments: [CameraSegment], selected: Array<CameraSegment>.Index, edits: [EditorViewController.Edit?]?) -> MediaPlayerController {
let controller: MediaPlayerController
if settings.features.multipleExports && settings.features.editor {
if segments.indices.contains(selected) {
multiEditorViewController?.addSegment(segments[selected])
segments.forEach { segment in
multiEditorViewController?.addSegment(segment)
}
controller = multiEditorViewController ?? createStoryViewController(segments, selected: selected, edits: edits)
multiEditorViewController = controller as? MultiEditorViewController
Expand Down
5 changes: 5 additions & 0 deletions Classes/Rendering/MediaPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ final class MediaPlayer {
init(renderer: Rendering?) {
self.renderer = renderer ?? Renderer()
self.renderer.delegate = self
do {
try AVAudioSession.sharedInstance().setCategory(.playback, mode: .default)
} catch let error {
print("Failed to set audio session category: \(error)")
}
}

deinit {
Expand Down
6 changes: 5 additions & 1 deletion Classes/Utility/Device.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public struct KanvasDevice {
static let iPhone11ScreenHeight = 896
static let iPhone11ProScreenHeight = 812
static let iPhone11ProMaxScreenHeight = 896
static let iPhone12ProScreenHeight = 844
static let iPhone12ProMaxScreenHeight = 926
static let retinaScreenMinScale: CGFloat = 2.0

// Device type
Expand All @@ -44,8 +46,10 @@ public struct KanvasDevice {
static let isIPhone11: Bool = isIPhone && screenMaxLength == iPhone11ScreenHeight
static let isIPhone11Pro: Bool = isIPhone && screenMaxLength == iPhone11ProScreenHeight
static let isIPhone11ProMax: Bool = isIPhone && screenMaxLength == iPhone11ProMaxScreenHeight
static let isIPhone12Pro: Bool = isIPhone && screenMaxLength == iPhone12ProScreenHeight
static let isIPhone12ProMax: Bool = isIPhone && screenMaxLength == iPhone12ProMaxScreenHeight

// Device group
// This group represents all devices which have extra safe space at the top and the bottom, as well as rounded screen corners.
public static let belongsToIPhoneXGroup: Bool = isIPhoneX || isIPhoneXR || isIPhoneXS || isIPhoneXSMax || isIPhone11 || isIPhone11Pro || isIPhone11ProMax
public static let belongsToIPhoneXGroup: Bool = isIPhoneX || isIPhoneXR || isIPhoneXS || isIPhoneXSMax || isIPhone11 || isIPhone11Pro || isIPhone11ProMax || isIPhone12Pro || isIPhone12ProMax
}
2 changes: 1 addition & 1 deletion Kanvas.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "Kanvas"
spec.version = "1.2.2"
spec.version = "1.2.3"
spec.summary = "A custom camera built for iOS."
spec.homepage = "https://github.com/tumblr/kanvas-ios"
spec.license = "MPLv2"
Expand Down

0 comments on commit f4d5428

Please sign in to comment.