-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132 from boostcampwm-2024/feature/load-video-in-edit
책 생성 & 페이지 볼 때 �비디오 저장 및 불러오기 구현
- Loading branch information
Showing
19 changed files
with
314 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
MemorialHouse/MHPresentation/MHPresentation/Source/Design/MHVideoView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import AVKit | ||
import MHCore | ||
import MHDomain | ||
|
||
final class MHVideoView: UIView { | ||
// MARK: - Property | ||
let playerViewController = AVPlayerViewController() | ||
|
||
// MARK: - Initializer | ||
init() { | ||
super.init(frame: .zero) | ||
configureConstraint() | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
super.init(coder: coder) | ||
configureConstraint() | ||
} | ||
|
||
// MARK: - Configuration | ||
func configurePlayer(player: AVPlayer) { | ||
playerViewController.player = player | ||
playerViewController.showsPlaybackControls = true | ||
} | ||
|
||
private func configureConstraint() { | ||
addSubview(playerViewController.view) | ||
playerViewController.view.fillSuperview() | ||
} | ||
} | ||
|
||
extension MHVideoView: @preconcurrency MediaAttachable { | ||
func configureSource(with mediaDescription: MediaDescription, data: Data) { | ||
let player = AVPlayer() | ||
configurePlayer(player: player) | ||
} | ||
|
||
func configureSource(with mediaDescription: MediaDescription, url: URL) { | ||
let player = AVPlayer(url: url) | ||
configurePlayer(player: player) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.