-
Couldn't load subscription status.
- Fork 240
Video playback handling in VideoArkitPlugin #245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Video playback handling in VideoArkitPlugin #245
Conversation
RuslanTsitser
commented
Apr 8, 2025
- Added video payback control
- Added video file support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please update one of the examples with the proposed functionality? We rely on these examples for manual smoke testing to confirm the plugin works correctly before releasing new updates.
| switch call.method { | ||
| case "play": | ||
| VideoArkitPlugin.nodes[id]?.play() | ||
| VideoArkitPlugin.players[id]?.play() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't that be a breaking change for folks who use SKVideoNode?
|
|
||
| /// Seek video to a specific time. | ||
| Future<void> seekTo(Duration duration) => | ||
| _channel.invokeMethod<void>('seek', {'id': id, 'seconds': duration.inSeconds}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using milliseconds would be a better fit, as it gives users finer control over the timing.
| } else if let filePath = dict["filePath"] as? String { | ||
| let videoFileURL = URL(fileURLWithPath: filePath) | ||
| videoPlayer = AVPlayer(url: videoFileURL) | ||
| videoNode = SKVideoNode(avPlayer: videoPlayer!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid using force unwraps. If videoPlayer creation fails, call logPluginError instead.
| String? filename, | ||
| String? url, | ||
| bool? autoplay = true, | ||
| String? filePath, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For users, the distinction between filename and filePath might not be obvious. What benefits do we gain from using SKVideoNode(fileNamed: videoFilename)? Do you think it would be more consistent to always rely on SKVideoNode(avPlayer: videoPlayer) instead?