I'm using SwiftUI to play videos. I'm trying to use a NavigationStack to show a list of videos, then when i click on on it goes to a new view to play that video. I see lots of example that have the underlying AVPlayer in a @State or @StateObject, but as soon as I reassign it to a new AVPlayer the VideoPlayer stops working; I just get a black screen.
Is there a better way to change the url that VideoPlayer is playing? I'm trying to avoid creating a bunch of VideoPlayer objects ahead of time and having them all in memory, as this might have a large number of videos.
More details: App is TVOS 17, using Xcode 15.
Post
Replies
Boosts
Views
Activity
I've seen applications such as Dante Via (Audinate) and Loopback (Rogue Amoeba) that can capture audio from an application directly. Which framework is used to achieve this? So far all I've seen is ways to tap in to audio devices with AUs.
One of the possible solutions to a problem that I'm working on is to have two Drivers loading in one DriverKit dext, an IOUserHIDEventService and an IOUserHIDDevice. For this to work, however, I need to have the event service send a message to the Device. IOKit has the service and connection objects that I can use just like an app would (just like the app the driver communication example). But DriverKit complains whenever I try to add the IOKit framework, saying that it is not supported. Is there another way that I can send a message directly from one driver to another?
The documentation for IOHIDUserService lists the following instance method:
virtual void dispatchEvent(IOHIDEvent *event);
It specifically says, "You can also call it directly to dispatch events for which you create an IOHIDEvent object." I see nowhere in any documentation on the details for the IOHIDEvent class and creating your own. Google searches let me find https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-368.20/IOHIDFamily/IOHIDEvent.h.auto.html
Unfortunately i see nowhere on my computer where IOHIDEvent.h exists.
Is this something i'm going to have to build/pull in manually, or is there a framework that I'm just not seeing that I can pull in to create an IOHIDEvent?
I have been trying to get a stub DriverKit driver loading on my computers without success. I keep getting errors regarding the code signature being invalid. I've been beating my head against the wall for a couple weeks now, so I'd appreciate the help.
Layout: Standard Application that does the install/removal. BundleId (changed to protect the innocent) com.somename.someapp. Second target with DriverKit driver: com.somename.someapp.mydriver. To start out this is an IOUserHIDEventService.
Question 1) I assume these need to be different with their own entitlements. Is that correct?
Question 2) this is my current Entitlement layout; App has SystemExtension. Driver has DriverKit, DriverKit HID Transport, and DriverKit HID Event Service Family. Is this correct for this layout?
Question 3) Does the Code Signing Identity/Profile in the Apple Developer section need to match exactly, or can that have more than what is requested? (I started equal, but gave more just to try to troubleshoot)
Question 4) I have requested and have been approved to have the "Additional Capabilities" versions of the DriverKit entitlements in Identities. Do i need both checked? can I only have the distribution one?
Question 5) I have SIP disabled on my machine (csrutil status shows disabled). I thought this was supposed to bypass the code signing checks? I still see the driver loading being killed because of invalid code signing.
Question 6) Does the "Additional Capabilities" version of the DriverKit entitlements that I needed get get approval for bypass the need to disable SIP, or will i need to keep it off for the entirety of development?
Thanks!
Since Logitech isn't updating their mouse software for M1 after almost two years, i'm going to try to make my own 'driver' for it. In doing so I want to create a virtual HID device that i can tell to send joystick button presses when I press my mouse's macro keys (G600). Looks like to do this properly i would want to create two drivers, one as an HID service IOUserHIDEventService that translates the mouse's HID reports, and an IOUserUSBHostHIDDevice that will create a new HID device with its own descriptor and reports. So that begs the question, can an application contain more than one driver module, or is it limited to one at a time?
I am trying to add instance variables to my DriverKit class. I declare them in the class definition in the .iig file but when i try to access them in the .cpp file i get an error "Use of undeclared identifier". Is there a limitation that prevents instance variables in the classes defined for DriverKit?
.iig file
class VirtualJoystick: public IOUserUSBHostHIDDevice
{
public:
virtual kern_return_t
Start(IOService * provider) override;
virtual kern_return_t
Stop(IOService * provider) override;
virtual bool init() override;
virtual void free() override;
virtual OSDictionary * newDeviceDescription(void) override;
virtual OSData * newReportDescriptor(void) override;
virtual kern_return_t getReport(
IOMemoryDescriptor *report,
IOHIDReportType reportType,
IOOptionBits options,
uint32_t completionTimeout,
OSAction *action
) override;
private:
// the stored state of all the buttons
uint32_t _buttons = 0;
};
example Usage in .cpp
bool VirtualJoystick::init() {
this->_buttons = 0; // Use of undeclared identifier '_buttons'
}