Skip to content

Commit 212b75e

Browse files
committed
loop video and use local video file
1 parent 130c7c2 commit 212b75e

File tree

7 files changed

+35
-55
lines changed

7 files changed

+35
-55
lines changed

DDDKit/Classes/DDD360VideoView.swift

+5
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ open class DDD360VideoViewController: DDDViewController {
5959
self.player?.replaceCurrentItem(with: self.playerItem!)
6060

6161
self.player?.play()
62+
63+
NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: self.playerItem!, queue: .main) { [weak self] _ in
64+
self?.player?.seek(to: kCMTimeZero)
65+
self?.player?.play()
66+
}
6267
}
6368
}
6469
})

DDDKit/Classes/DDDNode.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ An element that can be put in a 3d scene
2424
*/
2525
public class DDDNode {
2626
/// The node position from the origin
27-
public var position = Vec3.Zero()
27+
public var position: Vec3 = Vec3.Zero()
2828
/// The node rotation, in quaternion, from the camera orientation
2929
public var rotation = Quat.fromValues(x: 0, y: 0, z: 0, w: 1)
3030
/// Describes the shape of the node, and how texture are mapped on that shape

Example/DDDKit.xcodeproj/project.pbxproj

+12-48
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
1515
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
1616
607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; };
17+
63A6F5E221DD0DCB000FD275 /* video-sample.qt in Resources */ = {isa = PBXBuildFile; fileRef = 63A6F5E121DD0DCB000FD275 /* video-sample.qt */; };
1718
BA549D0F393C77AF0B3F59F7 /* Pods_DDDKit_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF38EB7E9F1B634ADF2BEB2F /* Pods_DDDKit_Tests.framework */; };
1819
/* End PBXBuildFile section */
1920

@@ -39,6 +40,7 @@
3940
607FACE51AFB9204008FA782 /* DDDKit_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DDDKit_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4041
607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4142
607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = "<group>"; };
43+
63A6F5E121DD0DCB000FD275 /* video-sample.qt */ = {isa = PBXFileReference; lastKnownFileType = file; path = "video-sample.qt"; sourceTree = "<group>"; };
4244
9589DB43EAA949764871609E /* Pods-DDDKit_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DDDKit_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-DDDKit_Example/Pods-DDDKit_Example.debug.xcconfig"; sourceTree = "<group>"; };
4345
96739BBF70DB308E60E51CD2 /* Pods-DDDKit_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DDDKit_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-DDDKit_Tests/Pods-DDDKit_Tests.release.xcconfig"; sourceTree = "<group>"; };
4446
A70B75B225C9B9E9EA0A93D3 /* Pods_DDDKit_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_DDDKit_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -93,6 +95,7 @@
9395
607FACD21AFB9204008FA782 /* Example for DDDKit */ = {
9496
isa = PBXGroup;
9597
children = (
98+
63A6F5E021DD0DBD000FD275 /* Assets */,
9699
607FACD51AFB9204008FA782 /* AppDelegate.swift */,
97100
607FACD71AFB9204008FA782 /* ViewController.swift */,
98101
607FACD91AFB9204008FA782 /* Main.storyboard */,
@@ -139,6 +142,14 @@
139142
name = "Podspec Metadata";
140143
sourceTree = "<group>";
141144
};
145+
63A6F5E021DD0DBD000FD275 /* Assets */ = {
146+
isa = PBXGroup;
147+
children = (
148+
63A6F5E121DD0DCB000FD275 /* video-sample.qt */,
149+
);
150+
path = Assets;
151+
sourceTree = "<group>";
152+
};
142153
6672E850884C09B19218B9AA /* Pods */ = {
143154
isa = PBXGroup;
144155
children = (
@@ -171,7 +182,6 @@
171182
607FACCD1AFB9204008FA782 /* Frameworks */,
172183
607FACCE1AFB9204008FA782 /* Resources */,
173184
D3DD1A4CFB2903035A0E8DF4 /* [CP] Embed Pods Frameworks */,
174-
CE43A5305CC351BC41F0C210 /* [CP] Copy Pods Resources */,
175185
);
176186
buildRules = (
177187
);
@@ -190,8 +200,6 @@
190200
607FACE11AFB9204008FA782 /* Sources */,
191201
607FACE21AFB9204008FA782 /* Frameworks */,
192202
607FACE31AFB9204008FA782 /* Resources */,
193-
5E79D9A5EA2DFC2FE5E27EBE /* [CP] Embed Pods Frameworks */,
194-
9E6CE64D34783BBF36A68632 /* [CP] Copy Pods Resources */,
195203
);
196204
buildRules = (
197205
);
@@ -250,6 +258,7 @@
250258
isa = PBXResourcesBuildPhase;
251259
buildActionMask = 2147483647;
252260
files = (
261+
63A6F5E221DD0DCB000FD275 /* video-sample.qt in Resources */,
253262
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */,
254263
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */,
255264
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */,
@@ -266,36 +275,6 @@
266275
/* End PBXResourcesBuildPhase section */
267276

268277
/* Begin PBXShellScriptBuildPhase section */
269-
5E79D9A5EA2DFC2FE5E27EBE /* [CP] Embed Pods Frameworks */ = {
270-
isa = PBXShellScriptBuildPhase;
271-
buildActionMask = 2147483647;
272-
files = (
273-
);
274-
inputPaths = (
275-
);
276-
name = "[CP] Embed Pods Frameworks";
277-
outputPaths = (
278-
);
279-
runOnlyForDeploymentPostprocessing = 0;
280-
shellPath = /bin/sh;
281-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-DDDKit_Tests/Pods-DDDKit_Tests-frameworks.sh\"\n";
282-
showEnvVarsInLog = 0;
283-
};
284-
9E6CE64D34783BBF36A68632 /* [CP] Copy Pods Resources */ = {
285-
isa = PBXShellScriptBuildPhase;
286-
buildActionMask = 2147483647;
287-
files = (
288-
);
289-
inputPaths = (
290-
);
291-
name = "[CP] Copy Pods Resources";
292-
outputPaths = (
293-
);
294-
runOnlyForDeploymentPostprocessing = 0;
295-
shellPath = /bin/sh;
296-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-DDDKit_Tests/Pods-DDDKit_Tests-resources.sh\"\n";
297-
showEnvVarsInLog = 0;
298-
};
299278
B1DEB8F42BFCD9B6B322B79C /* [CP] Check Pods Manifest.lock */ = {
300279
isa = PBXShellScriptBuildPhase;
301280
buildActionMask = 2147483647;
@@ -314,21 +293,6 @@
314293
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
315294
showEnvVarsInLog = 0;
316295
};
317-
CE43A5305CC351BC41F0C210 /* [CP] Copy Pods Resources */ = {
318-
isa = PBXShellScriptBuildPhase;
319-
buildActionMask = 2147483647;
320-
files = (
321-
);
322-
inputPaths = (
323-
);
324-
name = "[CP] Copy Pods Resources";
325-
outputPaths = (
326-
);
327-
runOnlyForDeploymentPostprocessing = 0;
328-
shellPath = /bin/sh;
329-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-DDDKit_Example/Pods-DDDKit_Example-resources.sh\"\n";
330-
showEnvVarsInLog = 0;
331-
};
332296
D3DD1A4CFB2903035A0E8DF4 /* [CP] Embed Pods Frameworks */ = {
333297
isa = PBXShellScriptBuildPhase;
334298
buildActionMask = 2147483647;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

Example/DDDKit/Assets/video-sample.qt

12.1 MB
Binary file not shown.

Example/DDDKit/ViewController.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class ViewController: DDD360VideoViewController {
3232
}
3333

3434
private func setUpVideoPlayback() {
35-
show(from: URL(string: "https://s3.amazonaws.com/mettavr/adhoc-uploads/k2LytGGex5.qt")!)
35+
show(from: Bundle.main.url(forResource: "video-sample", withExtension: "qt")!)
3636
}
3737
}
38-

Example/Podfile.lock

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
PODS:
2-
- DDDKit (1.3.0):
2+
- DDDKit (1.4.0):
33
- GLMatrix (= 0.1.5)
44
- GLMatrix (0.1.5)
55

66
DEPENDENCIES:
77
- DDDKit (from `../`)
88

9+
SPEC REPOS:
10+
https://github.com/CocoaPods/Specs.git:
11+
- GLMatrix
12+
913
EXTERNAL SOURCES:
1014
DDDKit:
11-
:path: ../
15+
:path: "../"
1216

1317
SPEC CHECKSUMS:
14-
DDDKit: b091ad23c159efa7a12bcf4b0c7299413e26d7c1
18+
DDDKit: 945f641db78d48fde73027e32b05ac083ff7ddb9
1519
GLMatrix: 59e00baabb2b7d942c6c77ab09bdb2d020ccf91f
1620

1721
PODFILE CHECKSUM: 893c6a9bea368e31a28e21c2766ef70b7bb63463
1822

19-
COCOAPODS: 1.4.0
23+
COCOAPODS: 1.5.0

0 commit comments

Comments
 (0)