Skip to content

Commit 1680f6a

Browse files
authored
[SpriteKit] Simplify SKVideoNode creation code. (#22719)
We don't need the creation code for older OS versions, because we don't support those older OS versions anymore, which means we can just simplify this all to generated bindings.
1 parent 3b57c5e commit 1680f6a

File tree

5 files changed

+18
-119
lines changed

5 files changed

+18
-119
lines changed

src/SpriteKit/SKVideoNode.cs

-94
This file was deleted.

src/frameworks.sources

-1
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,6 @@ SPRITEKIT_SOURCES = \
16401640
SpriteKit/SKKeyframeSequence.cs \
16411641
SpriteKit/SKNode.cs \
16421642
SpriteKit/SKShapeNode.cs \
1643-
SpriteKit/SKVideoNode.cs \
16441643
SpriteKit/SKWarpGeometryGrid.cs \
16451644

16461645
# StoreKit

src/spritekit.cs

+18-20
Original file line numberDiff line numberDiff line change
@@ -1499,33 +1499,31 @@ partial interface SKVideoNode {
14991499
[Static, Export ("videoNodeWithAVPlayer:")]
15001500
SKVideoNode FromPlayer (AVPlayer player);
15011501

1502-
[Static, Export ("videoNodeWithVideoFileNamed:"), Internal]
1503-
SKVideoNode VideoNodeWithVideoFileNamed (string videoFile);
1502+
/// <summary>Create a video node from the named video file.</summary>
1503+
/// <param name="videoFile">The video file to create the <see cref="SKVideoNode" /> from.</param>
1504+
[Static, Export ("videoNodeWithFileNamed:")]
1505+
SKVideoNode FromFile (string videoFile);
15041506

1505-
[Static, Export ("videoNodeWithFileNamed:"), Internal]
1506-
SKVideoNode VideoNodeWithFileNamed (string videoFile);
1507-
1508-
[Static, Export ("videoNodeWithVideoURL:"), Internal]
1509-
SKVideoNode VideoNodeWithVideoURL (NSUrl videoURL);
1510-
1511-
[Static, Export ("videoNodeWithURL:"), Internal]
1512-
SKVideoNode VideoNodeWithURL (NSUrl videoURL);
1507+
/// <summary>Creates a video node from the file at the specified URL.</summary>
1508+
/// <param name="videoUrl">The video url to create the <see cref="SKVideoNode" /> from.</param>
1509+
[Static, Export ("videoNodeWithURL:")]
1510+
SKVideoNode FromUrl (NSUrl videoUrl);
15131511

15141512
[DesignatedInitializer]
15151513
[Export ("initWithAVPlayer:")]
15161514
NativeHandle Constructor (AVPlayer player);
15171515

1518-
[Export ("initWithVideoFileNamed:"), Internal]
1519-
IntPtr InitWithVideoFileNamed (string videoFile);
1520-
1521-
[Export ("initWithFileNamed:"), Internal]
1522-
IntPtr InitWithFileNamed (string videoFile);
1523-
1524-
[Export ("initWithVideoURL:"), Internal]
1525-
IntPtr InitWithVideoURL (NSUrl url);
1516+
/// <summary>Create a video node from the named video file.</summary>
1517+
/// <param name="videoFile">The video file to create the <see cref="SKVideoNode" /> from.</param>
1518+
[Export ("initWithFileNamed:")]
1519+
[DesignatedInitializer]
1520+
NativeHandle Constructor (string videoFile);
15261521

1527-
[Export ("initWithURL:"), Internal]
1528-
IntPtr InitWithURL (NSUrl url);
1522+
/// <summary>Creates a video node from the file at the specified URL.</summary>
1523+
/// <param name="url">The video url to create the <see cref="SKVideoNode" /> from.</param>
1524+
[Export ("initWithURL:")]
1525+
[DesignatedInitializer]
1526+
NativeHandle Constructor (NSUrl url);
15291527

15301528
[Export ("play")]
15311529
void Play ();

tests/cecil-tests/ConstructorTest.KnownFailures.cs

-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ public partial class ConstructorTest {
4646
"ModelIO.MDLMesh::.ctor(System.Numerics.Vector3,CoreGraphics.NVector3i,System.Boolean,ModelIO.MDLGeometryType,ModelIO.IMDLMeshBufferAllocator)",
4747
"ModelIO.MDLMesh::.ctor(System.Numerics.Vector3,System.Boolean,ModelIO.MDLGeometryType,ModelIO.IMDLMeshBufferAllocator)",
4848
"ModelIO.MDLNoiseTexture::.ctor(System.Single,System.String,CoreGraphics.NVector2i,ModelIO.MDLTextureChannelEncoding,ModelIO.MDLNoiseTextureType)",
49-
"SpriteKit.SKVideoNode::.ctor(Foundation.NSUrl)",
50-
"SpriteKit.SKVideoNode::.ctor(System.String)",
5149
"SpriteKit.SKWarpGeometryGrid::.ctor(System.IntPtr,System.IntPtr,System.Numerics.Vector2[],System.Numerics.Vector2[])",
5250
"UIKit.UIControlEventProxy::.ctor(UIKit.UIControl,System.EventHandler)",
5351
"UIKit.UIImageStatusDispatcher::.ctor(UIKit.UIImage/SaveStatus)",

tests/cecil-tests/SetHandleTest.KnownFailures.cs

-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ public partial class SetHandleTest {
2323
"ScreenCaptureKit.SCContentFilter::.ctor(ScreenCaptureKit.SCDisplay,ScreenCaptureKit.SCRunningApplication[],ScreenCaptureKit.SCWindow[],ScreenCaptureKit.SCContentFilterOption)",
2424
"ScreenCaptureKit.SCContentFilter::.ctor(ScreenCaptureKit.SCDisplay,ScreenCaptureKit.SCWindow[],ScreenCaptureKit.SCContentFilterOption)",
2525
"Security.SecTrust2::.ctor(Security.SecTrust)",
26-
"SpriteKit.SKVideoNode::.ctor(Foundation.NSUrl)",
27-
"SpriteKit.SKVideoNode::.ctor(System.String)",
2826
};
2927
}
3028
}

0 commit comments

Comments
 (0)