Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit a7c1ecb

Browse files
committed
Merge pull request #1671 from Eke/ASVideoPlayerNode
ASVideoPlayerNode initial version
2 parents bde4fe7 + 4f40f3c commit a7c1ecb

42 files changed

Lines changed: 3099 additions & 973 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AsyncDisplayKit.xcodeproj/project.pbxproj

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,14 @@
311311
7AB338691C55B97B0055FDE8 /* ASRelativeLayoutSpecSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7AB338681C55B97B0055FDE8 /* ASRelativeLayoutSpecSnapshotTests.mm */; };
312312
81EE384F1C8E94F000456208 /* ASRunLoopQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 81EE384D1C8E94F000456208 /* ASRunLoopQueue.h */; settings = {ATTRIBUTES = (Public, ); }; };
313313
81EE38501C8E94F000456208 /* ASRunLoopQueue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 81EE384E1C8E94F000456208 /* ASRunLoopQueue.mm */; };
314+
8B0768B31CE752EC002E1453 /* ASDefaultPlaybackButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0768B11CE752EC002E1453 /* ASDefaultPlaybackButton.h */; };
315+
8B0768B41CE752EC002E1453 /* ASDefaultPlaybackButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B0768B21CE752EC002E1453 /* ASDefaultPlaybackButton.m */; };
316+
8BBBAB8C1CEBAF1700107FC6 /* ASDefaultPlaybackButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0768B11CE752EC002E1453 /* ASDefaultPlaybackButton.h */; };
317+
8BBBAB8D1CEBAF1E00107FC6 /* ASDefaultPlaybackButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B0768B21CE752EC002E1453 /* ASDefaultPlaybackButton.m */; };
318+
8BDA5FC51CDBDDE1007D13B2 /* ASVideoPlayerNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BDA5FC31CDBDDE1007D13B2 /* ASVideoPlayerNode.h */; };
319+
8BDA5FC61CDBDDE1007D13B2 /* ASVideoPlayerNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8BDA5FC41CDBDDE1007D13B2 /* ASVideoPlayerNode.mm */; };
320+
8BDA5FC71CDBDF91007D13B2 /* ASVideoPlayerNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BDA5FC31CDBDDE1007D13B2 /* ASVideoPlayerNode.h */; };
321+
8BDA5FC81CDBDF95007D13B2 /* ASVideoPlayerNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8BDA5FC41CDBDDE1007D13B2 /* ASVideoPlayerNode.mm */; };
314322
92074A611CC8BA1900918F75 /* ASImageNode+tvOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 92074A5F1CC8BA1900918F75 /* ASImageNode+tvOS.h */; };
315323
92074A621CC8BA1900918F75 /* ASImageNode+tvOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 92074A5F1CC8BA1900918F75 /* ASImageNode+tvOS.h */; };
316324
92074A631CC8BA1900918F75 /* ASImageNode+tvOS.m in Sources */ = {isa = PBXBuildFile; fileRef = 92074A601CC8BA1900918F75 /* ASImageNode+tvOS.m */; };
@@ -820,6 +828,10 @@
820828
7AB338681C55B97B0055FDE8 /* ASRelativeLayoutSpecSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASRelativeLayoutSpecSnapshotTests.mm; sourceTree = "<group>"; };
821829
81EE384D1C8E94F000456208 /* ASRunLoopQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASRunLoopQueue.h; path = ../ASRunLoopQueue.h; sourceTree = "<group>"; };
822830
81EE384E1C8E94F000456208 /* ASRunLoopQueue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASRunLoopQueue.mm; path = ../ASRunLoopQueue.mm; sourceTree = "<group>"; };
831+
8B0768B11CE752EC002E1453 /* ASDefaultPlaybackButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASDefaultPlaybackButton.h; sourceTree = "<group>"; };
832+
8B0768B21CE752EC002E1453 /* ASDefaultPlaybackButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASDefaultPlaybackButton.m; sourceTree = "<group>"; };
833+
8BDA5FC31CDBDDE1007D13B2 /* ASVideoPlayerNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASVideoPlayerNode.h; sourceTree = "<group>"; };
834+
8BDA5FC41CDBDDE1007D13B2 /* ASVideoPlayerNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASVideoPlayerNode.mm; sourceTree = "<group>"; };
823835
92074A5F1CC8BA1900918F75 /* ASImageNode+tvOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASImageNode+tvOS.h"; sourceTree = "<group>"; };
824836
92074A601CC8BA1900918F75 /* ASImageNode+tvOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASImageNode+tvOS.m"; sourceTree = "<group>"; };
825837
92074A651CC8BADA00918F75 /* ASControlNode+tvOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASControlNode+tvOS.h"; sourceTree = "<group>"; };
@@ -908,6 +920,7 @@
908920
B30BF6511C5964B0004FCD53 /* ASLayoutManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ASLayoutManager.m; path = TextKit/ASLayoutManager.m; sourceTree = "<group>"; };
909921
B35061DA1B010EDF0018CF92 /* AsyncDisplayKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AsyncDisplayKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
910922
B35061DD1B010EDF0018CF92 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = "../AsyncDisplayKit-iOS/Info.plist"; sourceTree = "<group>"; };
923+
BDC2D162BD55A807C1475DA5 /* Pods-AsyncDisplayKitTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AsyncDisplayKitTests.profile.xcconfig"; path = "Pods/Target Support Files/Pods-AsyncDisplayKitTests/Pods-AsyncDisplayKitTests.profile.xcconfig"; sourceTree = "<group>"; };
911924
CC3B20811C3F76D600798563 /* ASPendingStateController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASPendingStateController.h; sourceTree = "<group>"; };
912925
CC3B20821C3F76D600798563 /* ASPendingStateController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASPendingStateController.mm; sourceTree = "<group>"; };
913926
CC3B20871C3F7A5400798563 /* ASWeakSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASWeakSet.h; sourceTree = "<group>"; };
@@ -1064,6 +1077,8 @@
10641077
92DD2FE21BF4B97E0074C9DD /* ASMapNode.mm */,
10651078
AEEC47DF1C20C2DD00EC1693 /* ASVideoNode.h */,
10661079
AEEC47E01C20C2DD00EC1693 /* ASVideoNode.mm */,
1080+
8BDA5FC31CDBDDE1007D13B2 /* ASVideoPlayerNode.h */,
1081+
8BDA5FC41CDBDDE1007D13B2 /* ASVideoPlayerNode.mm */,
10671082
055F1A3A19ABD43F004DAFF1 /* ASCellNode.h */,
10681083
AC6456071B0A335000CF11B8 /* ASCellNode.mm */,
10691084
18C2ED7C1B9B7DE800F627B3 /* ASCollectionNode.h */,
@@ -1332,6 +1347,8 @@
13321347
CC3B20881C3F7A5400798563 /* ASWeakSet.m */,
13331348
DBC452D91C5BF64600B16017 /* NSArray+Diffing.h */,
13341349
DBC452DA1C5BF64600B16017 /* NSArray+Diffing.m */,
1350+
8B0768B11CE752EC002E1453 /* ASDefaultPlaybackButton.h */,
1351+
8B0768B21CE752EC002E1453 /* ASDefaultPlaybackButton.m */,
13351352
);
13361353
path = Private;
13371354
sourceTree = "<group>";
@@ -1476,6 +1493,7 @@
14761493
children = (
14771494
FB07EABBCF28656C6297BC2D /* Pods-AsyncDisplayKitTests.debug.xcconfig */,
14781495
D3779BCFF841AD3EB56537ED /* Pods-AsyncDisplayKitTests.release.xcconfig */,
1496+
BDC2D162BD55A807C1475DA5 /* Pods-AsyncDisplayKitTests.profile.xcconfig */,
14791497
);
14801498
name = Pods;
14811499
sourceTree = "<group>";
@@ -1570,6 +1588,7 @@
15701588
DBDB83941C6E879900D0098C /* ASPagerFlowLayout.h in Headers */,
15711589
058D0A4F195D05CB00B7D73C /* ASImageNode.h in Headers */,
15721590
05F20AA41A15733C00DCA68A /* ASImageProtocols.h in Headers */,
1591+
8BDA5FC51CDBDDE1007D13B2 /* ASVideoPlayerNode.h in Headers */,
15731592
430E7C8F1B4C23F100697A4C /* ASIndexPath.h in Headers */,
15741593
ACF6ED221B17843500DA7C62 /* ASInsetLayoutSpec.h in Headers */,
15751594
ACF6ED4B1B17847A00DA7C62 /* ASInternalHelpers.h in Headers */,
@@ -1591,6 +1610,7 @@
15911610
B13CA1001C52004900E031AB /* ASCollectionNode+Beta.h in Headers */,
15921611
0442850D1BAA64EC00D16268 /* ASMultidimensionalArrayUtils.h in Headers */,
15931612
0516FA401A1563D200B4EBED /* ASMultiplexImageNode.h in Headers */,
1613+
8B0768B31CE752EC002E1453 /* ASDefaultPlaybackButton.h in Headers */,
15941614
058D0A59195D05DC00B7D73C /* ASMutableAttributedStringBuilder.h in Headers */,
15951615
055B9FA81A1C154B00035D6D /* ASNetworkImageNode.h in Headers */,
15961616
ACF6ED2B1B17843500DA7C62 /* ASOverlayLayoutSpec.h in Headers */,
@@ -1747,6 +1767,7 @@
17471767
DECBD6E81BE56E1900CF4905 /* ASButtonNode.h in Headers */,
17481768
B35062241B010EFD0018CF92 /* ASMutableAttributedStringBuilder.h in Headers */,
17491769
B13CA0F81C519EBA00E031AB /* ASCollectionViewLayoutFacilitatorProtocol.h in Headers */,
1770+
8BBBAB8C1CEBAF1700107FC6 /* ASDefaultPlaybackButton.h in Headers */,
17501771
B35062061B010EFD0018CF92 /* ASNetworkImageNode.h in Headers */,
17511772
34EFC76C1B701CED00AD841F /* ASOverlayLayoutSpec.h in Headers */,
17521773
B35062261B010EFD0018CF92 /* ASRangeController.h in Headers */,
@@ -1790,6 +1811,7 @@
17901811
B350623A1B010EFD0018CF92 /* NSMutableAttributedString+TextKitAdditions.h in Headers */,
17911812
044284FF1BAA3BD600D16268 /* UICollectionViewLayout+ASConvenience.h in Headers */,
17921813
B35062431B010EFD0018CF92 /* UIView+ASConvenience.h in Headers */,
1814+
8BDA5FC71CDBDF91007D13B2 /* ASVideoPlayerNode.h in Headers */,
17931815
);
17941816
runOnlyForDeploymentPostprocessing = 0;
17951817
};
@@ -1836,12 +1858,12 @@
18361858
isa = PBXNativeTarget;
18371859
buildConfigurationList = 058D09D2195D04C000B7D73C /* Build configuration list for PBXNativeTarget "AsyncDisplayKitTests" */;
18381860
buildPhases = (
1839-
2E61B6A0DB0F436A9DDBE86F /* Check Pods Manifest.lock */,
1861+
2E61B6A0DB0F436A9DDBE86F /* 📦 Check Pods Manifest.lock */,
18401862
058D09B8195D04C000B7D73C /* Sources */,
18411863
058D09B9195D04C000B7D73C /* Frameworks */,
18421864
058D09BA195D04C000B7D73C /* Resources */,
1843-
3B9D88CDF51B429C8409E4B6 /* Copy Pods Resources */,
1844-
B130AB1AC0A1E5162E211C19 /* Embed Pods Frameworks */,
1865+
3B9D88CDF51B429C8409E4B6 /* 📦 Copy Pods Resources */,
1866+
B130AB1AC0A1E5162E211C19 /* 📦 Embed Pods Frameworks */,
18451867
);
18461868
buildRules = (
18471869
);
@@ -1942,44 +1964,44 @@
19421964
/* End PBXResourcesBuildPhase section */
19431965

19441966
/* Begin PBXShellScriptBuildPhase section */
1945-
2E61B6A0DB0F436A9DDBE86F /* Check Pods Manifest.lock */ = {
1967+
2E61B6A0DB0F436A9DDBE86F /* 📦 Check Pods Manifest.lock */ = {
19461968
isa = PBXShellScriptBuildPhase;
19471969
buildActionMask = 2147483647;
19481970
files = (
19491971
);
19501972
inputPaths = (
19511973
);
1952-
name = "Check Pods Manifest.lock";
1974+
name = "📦 Check Pods Manifest.lock";
19531975
outputPaths = (
19541976
);
19551977
runOnlyForDeploymentPostprocessing = 0;
19561978
shellPath = /bin/sh;
19571979
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
19581980
showEnvVarsInLog = 0;
19591981
};
1960-
3B9D88CDF51B429C8409E4B6 /* Copy Pods Resources */ = {
1982+
3B9D88CDF51B429C8409E4B6 /* 📦 Copy Pods Resources */ = {
19611983
isa = PBXShellScriptBuildPhase;
19621984
buildActionMask = 2147483647;
19631985
files = (
19641986
);
19651987
inputPaths = (
19661988
);
1967-
name = "Copy Pods Resources";
1989+
name = "📦 Copy Pods Resources";
19681990
outputPaths = (
19691991
);
19701992
runOnlyForDeploymentPostprocessing = 0;
19711993
shellPath = /bin/sh;
19721994
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AsyncDisplayKitTests/Pods-AsyncDisplayKitTests-resources.sh\"\n";
19731995
showEnvVarsInLog = 0;
19741996
};
1975-
B130AB1AC0A1E5162E211C19 /* Embed Pods Frameworks */ = {
1997+
B130AB1AC0A1E5162E211C19 /* 📦 Embed Pods Frameworks */ = {
19761998
isa = PBXShellScriptBuildPhase;
19771999
buildActionMask = 2147483647;
19782000
files = (
19792001
);
19802002
inputPaths = (
19812003
);
1982-
name = "Embed Pods Frameworks";
2004+
name = "📦 Embed Pods Frameworks";
19832005
outputPaths = (
19842006
);
19852007
runOnlyForDeploymentPostprocessing = 0;
@@ -2004,6 +2026,7 @@
20042026
buildActionMask = 2147483647;
20052027
files = (
20062028
058D0A22195D050800B7D73C /* _ASAsyncTransaction.mm in Sources */,
2029+
8B0768B41CE752EC002E1453 /* ASDefaultPlaybackButton.m in Sources */,
20072030
E55D86321CA8A14000A0C26F /* ASLayoutable.mm in Sources */,
20082031
68FC85E41CE29B7E00EDD713 /* ASTabBarController.m in Sources */,
20092032
058D0A23195D050800B7D73C /* _ASAsyncTransactionContainer.m in Sources */,
@@ -2108,6 +2131,7 @@
21082131
055F1A3519ABD3E3004DAFF1 /* ASTableView.mm in Sources */,
21092132
058D0A17195D050800B7D73C /* ASTextNode.mm in Sources */,
21102133
257754AC1BEE44CD00737CA5 /* ASTextKitRenderer.mm in Sources */,
2134+
8BDA5FC61CDBDDE1007D13B2 /* ASVideoPlayerNode.mm in Sources */,
21112135
205F0E221B376416007741D0 /* CGRect+ASConvenience.m in Sources */,
21122136
257754B21BEE44CD00737CA5 /* ASTextKitShadower.mm in Sources */,
21132137
9CFFC6BE1CCAC52B006A6476 /* ASEnvironment.mm in Sources */,
@@ -2164,6 +2188,7 @@
21642188
buildActionMask = 2147483647;
21652189
files = (
21662190
9C70F2091CDABA36007D6C76 /* ASViewController.mm in Sources */,
2191+
8BBBAB8D1CEBAF1E00107FC6 /* ASDefaultPlaybackButton.m in Sources */,
21672192
DE4843DB1C93EAB100A1F33B /* ASLayoutTransition.mm in Sources */,
21682193
B30BF6541C59D889004FCD53 /* ASLayoutManager.m in Sources */,
21692194
92DD2FE71BF4D0850074C9DD /* ASMapNode.mm in Sources */,
@@ -2252,6 +2277,7 @@
22522277
B35062091B010EFD0018CF92 /* ASScrollNode.m in Sources */,
22532278
B35062561B010EFD0018CF92 /* ASSentinel.m in Sources */,
22542279
9C8221981BA237B80037F19A /* ASStackBaselinePositionedLayout.mm in Sources */,
2280+
8BDA5FC81CDBDF95007D13B2 /* ASVideoPlayerNode.mm in Sources */,
22552281
34EFC7721B701D0300AD841F /* ASStackLayoutSpec.mm in Sources */,
22562282
34EFC7761B701D2A00AD841F /* ASStackPositionedLayout.mm in Sources */,
22572283
7AB338661C55B3420055FDE8 /* ASRelativeLayoutSpec.mm in Sources */,
@@ -2648,7 +2674,7 @@
26482674
};
26492675
DB1020821CBCA2AD00FA6FE1 /* Profile */ = {
26502676
isa = XCBuildConfiguration;
2651-
baseConfigurationReference = D3779BCFF841AD3EB56537ED /* Pods-AsyncDisplayKitTests.release.xcconfig */;
2677+
baseConfigurationReference = BDC2D162BD55A807C1475DA5 /* Pods-AsyncDisplayKitTests.profile.xcconfig */;
26522678
buildSettings = {
26532679
BUNDLE_LOADER = "$(TEST_HOST)";
26542680
CLANG_ENABLE_CODE_COVERAGE = YES;

AsyncDisplayKit/ASVideoNode.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
typedef enum {
1616
ASVideoNodePlayerStateUnknown,
1717
ASVideoNodePlayerStateInitialLoading,
18-
ASVideoNodePlayerStateLoading,
18+
ASVideoNodePlayerStateReadyToPlay,
19+
ASVideoNodePlayerStatePlaybackLikelyToKeepUpButNotPlaying,
1920
ASVideoNodePlayerStatePlaying,
21+
ASVideoNodePlayerStateLoading,
2022
ASVideoNodePlayerStatePaused,
2123
ASVideoNodePlayerStateFinished
2224
} ASVideoNodePlayerState;
@@ -40,6 +42,7 @@ NS_ASSUME_NONNULL_BEGIN
4042
@property (nullable, atomic, strong, readonly) AVPlayer *player;
4143
@property (nullable, atomic, strong, readonly) AVPlayerItem *currentItem;
4244

45+
4346
/**
4447
* When shouldAutoplay is set to true, a video node will play when it has both loaded and entered the "visible" interfaceState.
4548
* If it leaves the visible interfaceState it will pause but will resume once it has returned.
@@ -57,9 +60,6 @@ NS_ASSUME_NONNULL_BEGIN
5760
//! Defaults to AVLayerVideoGravityResizeAspect
5861
@property (atomic) NSString *gravity;
5962

60-
//! Defaults to an ASDefaultPlayButton instance.
61-
@property (nullable, atomic) ASButtonNode *playButton;
62-
6363
@property (nullable, atomic, weak, readwrite) id<ASVideoNodeDelegate> delegate;
6464

6565
@end

0 commit comments

Comments
 (0)