Skip to content

Commit 5b43dcb

Browse files
author
Oil3
committed
Webm Quicklook 1.1.feb252024
Better finder preview panel Quicklook Preview and Finder now supprt`Trackpad Gestur : pinch to zoom / two finges
1 parent ace9014 commit 5b43dcb

10 files changed

Lines changed: 89 additions & 140 deletions

File tree

Webm Quicklook.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
720ECCF32B82A74200FB29BF /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 720ECCF22B82A74200FB29BF /* Quartz.framework */; };
1414
720ECCF62B82A74300FB29BF /* PreviewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 720ECCF52B82A74300FB29BF /* PreviewViewController.swift */; };
1515
720ECD002B82A74300FB29BF /* WebM Quicklook.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 720ECCF02B82A74200FB29BF /* WebM Quicklook.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
16+
72A2BB7E2B8C60B5005038C4 /* sample.webm in Resources */ = {isa = PBXBuildFile; fileRef = 72A2BB7D2B8C60B5005038C4 /* sample.webm */; };
1617
72B4C90E2B82BDBB00CC6DC3 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 72B4C90D2B82BDBB00CC6DC3 /* WebKit.framework */; };
17-
72B4C9142B82E17200CC6DC3 /* sample.webm in Resources */ = {isa = PBXBuildFile; fileRef = 72B4C9132B82E17200CC6DC3 /* sample.webm */; };
1818
72B4C9172B82EAEA00CC6DC3 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 72B4C90D2B82BDBB00CC6DC3 /* WebKit.framework */; };
1919
72BAA8F22B86AC1A00C67112 /* QuickLookPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72B4C90F2B82E12E00CC6DC3 /* QuickLookPreview.swift */; };
2020
/* End PBXBuildFile section */
@@ -55,9 +55,9 @@
5555
720ECCF52B82A74300FB29BF /* PreviewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreviewViewController.swift; sourceTree = "<group>"; };
5656
720ECCFC2B82A74300FB29BF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
5757
720ECCFD2B82A74300FB29BF /* WebM_Quicklook.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WebM_Quicklook.entitlements; sourceTree = "<group>"; };
58+
72A2BB7D2B8C60B5005038C4 /* sample.webm */ = {isa = PBXFileReference; lastKnownFileType = file; path = sample.webm; sourceTree = "<group>"; };
5859
72B4C90D2B82BDBB00CC6DC3 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
5960
72B4C90F2B82E12E00CC6DC3 /* QuickLookPreview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuickLookPreview.swift; sourceTree = "<group>"; };
60-
72B4C9132B82E17200CC6DC3 /* sample.webm */ = {isa = PBXFileReference; lastKnownFileType = file; path = sample.webm; sourceTree = SOURCE_ROOT; };
6161
72B4C9152B82EACB00CC6DC3 /* QuickLookThumbnailing.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickLookThumbnailing.framework; path = System/Library/PrivateFrameworks/QuickLookThumbnailing.framework; sourceTree = SDKROOT; };
6262
/* End PBXFileReference section */
6363

@@ -105,8 +105,8 @@
105105
isa = PBXGroup;
106106
children = (
107107
7204BF932B8B21410035F558 /* Webm-Quicklook-Info.plist */,
108-
72B4C9132B82E17200CC6DC3 /* sample.webm */,
109108
720ECCDD2B82A21D00FB29BF /* Webm_QuicklookApp.swift */,
109+
72A2BB7D2B8C60B5005038C4 /* sample.webm */,
110110
720ECCDF2B82A21D00FB29BF /* ContentView.swift */,
111111
720ECCE12B82A21F00FB29BF /* Assets.xcassets */,
112112
72B4C90F2B82E12E00CC6DC3 /* QuickLookPreview.swift */,
@@ -216,7 +216,7 @@
216216
isa = PBXResourcesBuildPhase;
217217
buildActionMask = 2147483647;
218218
files = (
219-
72B4C9142B82E17200CC6DC3 /* sample.webm in Resources */,
219+
72A2BB7E2B8C60B5005038C4 /* sample.webm in Resources */,
220220
720ECCE22B82A21F00FB29BF /* Assets.xcassets in Resources */,
221221
);
222222
runOnlyForDeploymentPostprocessing = 0;

Webm Quicklook.xcodeproj/xcshareddata/xcschemes/Webm Quicklook.xcscheme

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
33
LastUpgradeVersion = "1520"
4-
wasCreatedForAppExtension = "YES"
5-
version = "2.2">
4+
version = "1.7">
65
<BuildAction
76
parallelizeBuildables = "YES"
87
buildImplicitDependencies = "YES">
98
<BuildActionEntries>
10-
<BuildActionEntry
11-
buildForTesting = "YES"
12-
buildForRunning = "YES"
13-
buildForProfiling = "YES"
14-
buildForArchiving = "YES"
15-
buildForAnalyzing = "YES">
16-
<BuildableReference
17-
BuildableIdentifier = "primary"
18-
BlueprintIdentifier = "720ECCEF2B82A74200FB29BF"
19-
BuildableName = "WebM Quicklook.appex"
20-
BlueprintName = "WebM Quicklook"
21-
ReferencedContainer = "container:Webm Quicklook.xcodeproj">
22-
</BuildableReference>
23-
</BuildActionEntry>
249
<BuildActionEntry
2510
buildForTesting = "YES"
2611
buildForRunning = "YES"
@@ -35,15 +20,6 @@
3520
ReferencedContainer = "container:Webm Quicklook.xcodeproj">
3621
</BuildableReference>
3722
</BuildActionEntry>
38-
<BuildActionEntry
39-
buildForTesting = "YES"
40-
buildForRunning = "YES"
41-
buildForProfiling = "NO"
42-
buildForArchiving = "YES"
43-
buildForAnalyzing = "NO">
44-
<AutocreatedTestPlanReference>
45-
</AutocreatedTestPlanReference>
46-
</BuildActionEntry>
4723
</BuildActionEntries>
4824
</BuildAction>
4925
<TestAction
@@ -55,39 +31,31 @@
5531
</TestAction>
5632
<LaunchAction
5733
buildConfiguration = "Debug"
58-
selectedDebuggerIdentifier = ""
59-
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
34+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
35+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
6036
launchStyle = "0"
61-
askForAppToLaunch = "Yes"
6237
useCustomWorkingDirectory = "NO"
6338
ignoresPersistentStateOnLaunch = "NO"
6439
debugDocumentVersioning = "YES"
6540
debugServiceExtension = "internal"
66-
allowLocationSimulation = "YES"
67-
launchAutomaticallySubstyle = "2">
68-
<RemoteRunnable
69-
runnableDebuggingMode = "2"
70-
BundleIdentifier = "com.apple.quicklook.QuickLookSimulator"
71-
RemotePath = "/System/Library/Frameworks/Quartz.framework/Versions/Current/Frameworks/QuickLookUI.framework/Versions/Current/Resources/Quick Look Simulator.app">
72-
</RemoteRunnable>
73-
<MacroExpansion>
41+
allowLocationSimulation = "YES">
42+
<BuildableProductRunnable
43+
runnableDebuggingMode = "0">
7444
<BuildableReference
7545
BuildableIdentifier = "primary"
7646
BlueprintIdentifier = "720ECCD92B82A21D00FB29BF"
7747
BuildableName = "Webm Quicklook.app"
7848
BlueprintName = "Webm Quicklook"
7949
ReferencedContainer = "container:Webm Quicklook.xcodeproj">
8050
</BuildableReference>
81-
</MacroExpansion>
51+
</BuildableProductRunnable>
8252
</LaunchAction>
8353
<ProfileAction
8454
buildConfiguration = "Release"
8555
shouldUseLaunchSchemeArgsEnv = "YES"
8656
savedToolIdentifier = ""
8757
useCustomWorkingDirectory = "NO"
88-
debugDocumentVersioning = "YES"
89-
askForAppToLaunch = "Yes"
90-
launchAutomaticallySubstyle = "2">
58+
debugDocumentVersioning = "YES">
9159
<BuildableProductRunnable
9260
runnableDebuggingMode = "0">
9361
<BuildableReference

Webm Quicklook.xcodeproj/xcshareddata/xcschemes/Webm Quicklook 1.xcscheme renamed to Webm Quicklook.xcodeproj/xcshareddata/xcschemes/WebmQuicklook.xcscheme

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
33
LastUpgradeVersion = "1520"
4-
version = "1.7">
4+
wasCreatedForAppExtension = "YES"
5+
version = "2.2">
56
<BuildAction
67
parallelizeBuildables = "YES"
78
buildImplicitDependencies = "YES">
89
<BuildActionEntries>
10+
<BuildActionEntry
11+
buildForTesting = "YES"
12+
buildForRunning = "YES"
13+
buildForProfiling = "YES"
14+
buildForArchiving = "YES"
15+
buildForAnalyzing = "YES">
16+
<BuildableReference
17+
BuildableIdentifier = "primary"
18+
BlueprintIdentifier = "720ECCEF2B82A74200FB29BF"
19+
BuildableName = "WebM Quicklook.appex"
20+
BlueprintName = "WebM Quicklook"
21+
ReferencedContainer = "container:Webm Quicklook.xcodeproj">
22+
</BuildableReference>
23+
</BuildActionEntry>
924
<BuildActionEntry
1025
buildForTesting = "YES"
1126
buildForRunning = "YES"
@@ -20,6 +35,15 @@
2035
ReferencedContainer = "container:Webm Quicklook.xcodeproj">
2136
</BuildableReference>
2237
</BuildActionEntry>
38+
<BuildActionEntry
39+
buildForTesting = "YES"
40+
buildForRunning = "YES"
41+
buildForProfiling = "NO"
42+
buildForArchiving = "YES"
43+
buildForAnalyzing = "NO">
44+
<AutocreatedTestPlanReference>
45+
</AutocreatedTestPlanReference>
46+
</BuildActionEntry>
2347
</BuildActionEntries>
2448
</BuildAction>
2549
<TestAction
@@ -31,31 +55,39 @@
3155
</TestAction>
3256
<LaunchAction
3357
buildConfiguration = "Debug"
34-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
35-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
58+
selectedDebuggerIdentifier = ""
59+
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
3660
launchStyle = "0"
61+
askForAppToLaunch = "Yes"
3762
useCustomWorkingDirectory = "NO"
3863
ignoresPersistentStateOnLaunch = "NO"
3964
debugDocumentVersioning = "YES"
4065
debugServiceExtension = "internal"
41-
allowLocationSimulation = "YES">
42-
<BuildableProductRunnable
43-
runnableDebuggingMode = "0">
66+
allowLocationSimulation = "YES"
67+
launchAutomaticallySubstyle = "2">
68+
<RemoteRunnable
69+
runnableDebuggingMode = "2"
70+
BundleIdentifier = "com.apple.quicklook.QuickLookSimulator"
71+
RemotePath = "/System/Library/Frameworks/Quartz.framework/Versions/Current/Frameworks/QuickLookUI.framework/Versions/Current/Resources/Quick Look Simulator.app">
72+
</RemoteRunnable>
73+
<MacroExpansion>
4474
<BuildableReference
4575
BuildableIdentifier = "primary"
4676
BlueprintIdentifier = "720ECCD92B82A21D00FB29BF"
4777
BuildableName = "Webm Quicklook.app"
4878
BlueprintName = "Webm Quicklook"
4979
ReferencedContainer = "container:Webm Quicklook.xcodeproj">
5080
</BuildableReference>
51-
</BuildableProductRunnable>
81+
</MacroExpansion>
5282
</LaunchAction>
5383
<ProfileAction
5484
buildConfiguration = "Release"
5585
shouldUseLaunchSchemeArgsEnv = "YES"
5686
savedToolIdentifier = ""
5787
useCustomWorkingDirectory = "NO"
58-
debugDocumentVersioning = "YES">
88+
debugDocumentVersioning = "YES"
89+
askForAppToLaunch = "Yes"
90+
launchAutomaticallySubstyle = "2">
5991
<BuildableProductRunnable
6092
runnableDebuggingMode = "0">
6193
<BuildableReference

Webm Quicklook.xcodeproj/xcuserdata/zzs.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,22 @@
33
uuid = "E71DBFCB-09D0-4E83-BE4F-3320B489D463"
44
type = "1"
55
version = "2.0">
6+
<Breakpoints>
7+
<BreakpointProxy
8+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
9+
<BreakpointContent
10+
uuid = "34F59CC5-109B-4EDA-B493-292435D4C957"
11+
shouldBeEnabled = "Yes"
12+
ignoreCount = "0"
13+
continueAfterRunningActions = "No"
14+
filePath = "Webm Quicklook/ContentView.swift"
15+
startingColumnNumber = "9223372036854775807"
16+
endingColumnNumber = "9223372036854775807"
17+
startingLineNumber = "11"
18+
endingLineNumber = "11"
19+
landmarkName = "ContentView"
20+
landmarkType = "14">
21+
</BreakpointContent>
22+
</BreakpointProxy>
23+
</Breakpoints>
624
</Bucket>

Webm Quicklook.xcodeproj/xcuserdata/zzs.xcuserdatad/xcschemes/xcschememanagement.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
<key>orderHint</key>
1010
<integer>1</integer>
1111
</dict>
12-
<key>Webm Quicklook 1.xcscheme_^#shared#^_</key>
12+
<key>Webm Quicklook.xcscheme_^#shared#^_</key>
1313
<dict>
1414
<key>orderHint</key>
1515
<integer>1</integer>
1616
</dict>
17-
<key>Webm Quicklook.xcscheme_^#shared#^_</key>
17+
<key>WebmQuicklook.xcscheme_^#shared#^_</key>
1818
<dict>
1919
<key>orderHint</key>
2020
<integer>0</integer>

Webm Quicklook/ContentView.swift

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,15 @@ struct ContentView: View {
1414
VStack {
1515
Image(systemName: "puzzlepiece.extension")
1616
Image(systemName: "powerplug")
17-
Text("Sample WebM file should play using Quicklook")
17+
18+
Text("Gesture zoom (trackpad) enabled, ")
1819
QuickLookPreview(url: sampleFileURL)
20+
.frame(width: 800, height: 300)
1921
.onDisappear {
20-
NSApplication.shared.terminate(nil)
21-
}
22-
}
23-
// .frame(width: 800, height: 300) // Set the desired frame size
24-
}
25-
}
26-
22+
NSApplication.shared.terminate(nil)
23+
}}}}
24+
//
2725

28-
// Preview for ContentView
2926
struct ContentView_Previews: PreviewProvider {
3027
static var previews: some View {
3128
ContentView()

Webm Quicklook/PreviewViewController copy.swift

Lines changed: 0 additions & 54 deletions
This file was deleted.

Webm Quicklook/PreviewViewController.swift

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,20 @@ class PreviewViewController: NSViewController, QLPreviewingController {
1515

1616
func preparePreviewOfFile(at url: URL, completionHandler: @escaping (Error?) -> Void) {
1717
webView.loadFileURL(url, allowingReadAccessTo: url)
18-
completionHandler(nil)
19-
}
18+
completionHandler(nil)
19+
}
2020

2121
override func loadView() {
2222
self.view = NSView()
2323
self.view.addSubview(webView)
24-
25-
webView.translatesAutoresizingMaskIntoConstraints = false
26-
NSLayoutConstraint.activate([
27-
webView.topAnchor.constraint(equalTo: view.topAnchor),
28-
webView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
29-
webView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
30-
webView.trailingAnchor.constraint(equalTo: view.trailingAnchor)
31-
])
32-
}
33-
34-
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
35-
let cssString = "::-webkit-media-controls-panel { display: none; }"
36-
let jsString = "var style = document.createElement('style'); style.innerHTML = '\(cssString)'; document.head.appendChild(style);"
37-
webView.evaluateJavaScript(jsString, completionHandler: nil)
38-
}
24+
//
25+
webView.pageZoom = 0.4
26+
webView.allowsMagnification = true
27+
// webView.configuration.mediaPlaybackRequiresUserAction = true
28+
webView.autoresizingMask = [.width, .height]
29+
webView.translatesAutoresizingMaskIntoConstraints = true
30+
}
3931
func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {
4032
print("Navigation failure: \(error.localizedDescription)")
41-
}
33+
}}
4234

43-
}

Webm Quicklook/Webm_QuicklookApp.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,5 @@ struct Webm_QuicklookApp: App {
1313
var body: some Scene {
1414
WindowGroup {
1515
ContentView()
16-
17-
}
18-
}
19-
}
16+
}}}
2017

File renamed without changes.

0 commit comments

Comments
 (0)