First, thank you, @cmsj, for #149 and for shipping the video element so
quickly in #157. Really appreciate it.
What's happening
Calling .video() on an hs.ui.window() and then .show()-ing the window
reliably crashes the app. Reproduced with a minimal script built directly
from this repo's own docstring example for .video():
const clip = HSVideo.fromURLs(["/path/to/any/file.mp4"]);
hs.ui.window({ x: 100, y: 100, w: 640, h: 360 })
.video(clip)
.frame({ w: 640, h: 360 })
.show();
clip.play();
What's been ruled out
- Not specific to any particular video file. Reproduced with an original
H.264/portrait source and with a completely vanilla ffmpeg-generated test
clip (640x480, 30fps, H.264 Main, AAC). Same crash either way.
- Not caused by surrounding app code. Reproduced with a from-scratch script
containing nothing but the four lines above, no shared helpers, no layout
containers, no window styling beyond the defaults.
- Not a threading issue. The entire crashing call stack is one unbroken
synchronous frame chain on com.apple.main-thread, rooted in
NSApplication sendEvent:.
Crash signature
SIGABRT via abort(), through swift::fatalError, getSuperclassMetadata,
_swift_initClassMetadataImpl, _AVKit_SwiftUI, ViewResponderFilter. init(inputs:view:), PlatformViewRepresentableFeature.modifyViewOutputs,
NSViewRepresentable._makeView, NSHostingView.viewDidMoveToWindow, and
finally NSWindow.setContentView:.
The failure is a Swift runtime generic-metadata instantiation error
(swift_getTypeByMangledName/getSuperclassMetadata) while resolving a
type needed by AVKit's VideoPlayer, which on macOS is backed by
NSViewRepresentable. It fires the moment the hosting view is attached to
the window.
Environment
A note on how this report was put together
This report, the diagnostic scripts, and the analysis above were produced
with AI assistance (Claude). I have not personally reviewed or verified the
Swift-level reasoning about why this happens (the generic-metadata /
NSViewRepresentable explanation). I can't read the Swift source myself. I
can vouch for the observable facts: the exact reproduction steps above, and
that I personally triggered the crash multiple times. Please treat the
"why" portion as a starting hypothesis from AI analysis of the crash trace,
not as something I've confirmed at the code level myself.
First, thank you, @cmsj, for #149 and for shipping the video element so
quickly in #157. Really appreciate it.
What's happening
Calling
.video()on anhs.ui.window()and then.show()-ing the windowreliably crashes the app. Reproduced with a minimal script built directly
from this repo's own docstring example for
.video():What's been ruled out
H.264/portrait source and with a completely vanilla ffmpeg-generated test
clip (640x480, 30fps, H.264 Main, AAC). Same crash either way.
containing nothing but the four lines above, no shared helpers, no layout
containers, no window styling beyond the defaults.
synchronous frame chain on
com.apple.main-thread, rooted inNSApplication sendEvent:.Crash signature
SIGABRTviaabort(), throughswift::fatalError,getSuperclassMetadata,_swift_initClassMetadataImpl,_AVKit_SwiftUI,ViewResponderFilter. init(inputs:view:),PlatformViewRepresentableFeature.modifyViewOutputs,NSViewRepresentable._makeView,NSHostingView.viewDidMoveToWindow, andfinally
NSWindow.setContentView:.The failure is a Swift runtime generic-metadata instantiation error
(
swift_getTypeByMangledName/getSuperclassMetadata) while resolving atype needed by AVKit's
VideoPlayer, which on macOS is backed byNSViewRepresentable. It fires the moment the hosting view is attached tothe window.
Environment
0.0.9(same commit as PR Add a video element to hs.ui. Closes #149 #157's merge, 7a2dcab. Appreports itself as version 1.2, build 87)
A note on how this report was put together
This report, the diagnostic scripts, and the analysis above were produced
with AI assistance (Claude). I have not personally reviewed or verified the
Swift-level reasoning about why this happens (the generic-metadata /
NSViewRepresentable explanation). I can't read the Swift source myself. I
can vouch for the observable facts: the exact reproduction steps above, and
that I personally triggered the crash multiple times. Please treat the
"why" portion as a starting hypothesis from AI analysis of the crash trace,
not as something I've confirmed at the code level myself.