Skip to content

Commit

Permalink
Use VLC player for mkv files
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Müller <[email protected]>
  • Loading branch information
SystemKeeper committed Aug 6, 2024
1 parent d15d6ea commit 56562b6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions NextcloudTalk/BaseChatViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3387,8 +3387,8 @@ import QuickLook
guard let fileLocalPath = fileStatus.fileLocalPath else { return }
let fileExtension = URL(fileURLWithPath: fileLocalPath).pathExtension.lowercased()

// For WebM we use the VLCKitVideoViewController because the native PreviewController does not support WebM
if fileExtension == "webm" {
// Use VLCKitVideoViewController for file formats unsupported by the native PreviewController
if VLCKitVideoViewController.supportedFileExtensions.contains(fileExtension) {
let vlcKitViewController = VLCKitVideoViewController(filePath: fileLocalPath)
vlcKitViewController.delegate = self
vlcKitViewController.modalPresentationStyle = .fullScreen
Expand Down
4 changes: 2 additions & 2 deletions NextcloudTalk/RoomSharedItemsTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ import QuickLook
self.previewControllerFilePath = fileLocalPath
self.isPreviewControllerShown = true

let fileExtension = NSURL(fileURLWithPath: fileLocalPath).pathExtension
let fileExtension = URL(fileURLWithPath: fileLocalPath).pathExtension.lowercased()

if fileExtension?.lowercased() == "webm" {
if VLCKitVideoViewController.supportedFileExtensions.contains(fileExtension) {
let vlcViewController = VLCKitVideoViewController(filePath: fileLocalPath)
vlcViewController.delegate = self
vlcViewController.modalPresentationStyle = .fullScreen
Expand Down
2 changes: 2 additions & 0 deletions NextcloudTalk/VLCKitVideoViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import MobileVLCKit

public weak var delegate: VLCKitVideoViewControllerDelegate?

public static let supportedFileExtensions = ["webm", "mkv"]

@IBOutlet weak var videoViewContainer: NCZoomableView!
@IBOutlet weak var buttonView: UIStackView!
@IBOutlet weak var jumpBackButton: UIButton!
Expand Down

0 comments on commit 56562b6

Please sign in to comment.