Embedding quicktime player in Cocoa app - cocoa

I'm wondering if it's possible for me to embed the quicktime player in a cocoa app. The default QTMovieView is kind of ugly, and the quicktime player window has all the features I need in it, such as full screen, and the maintain aspect ratio button.
I'd like it to operate transparently to the user though. I'd rather avoid making them launch the quicktime app. I'd also like to be able to position the window on the screen. Also, I need to be able to access the current playhead position, and capture when they stop the movie. Any ideas on how I might go about doing this? Or would I have to build out my own custom video player?
A third party component would be fine as well if any exist. I'm just looking for that same quicktime player appearance with the black control bar that appears when hovering over the screen.

Or would I have to build out my own custom video player?
Yes. There is no (reliable) way of getting QuickTime player to integrate into your application.
You should make a subclass of QTMovieView, and maybe use some subviews for the controls.

You can hide the controls if the QTMovieView if you do not like them. In IB switch off Show Controller property.
Alternatively, you can use QTMovieLayer.
Also, it is easy to create your own set of controls that will work directly with the properties and methods of the QTMovie.

Related

What AppKit controls / components were used to create the iMovie/FCP timeline scrubber?

I am interested in creating a video editor similar to iMovie on macOS. The scrubber is an interesting component, and I am wondering if anyone knows what control is used to create it.
My personal guess is that it is NSCollectionView.
It is a custom view. It is a subclass of TLKTimelineView called CETimelineView that is embedded in a custom scroll view called LKScrollView.
This makes sense as the video has to be in sync with the timeline, audio and video. Would require a highly optimized control. You can debug the view in xCode.

AVAudioPlayer along with seek bar and play pause button

I want to design audio player view to play my audio file.
I am bit confused about AVAudioPlayer working.
When I use AVAudioPlayer, it plays my audio file very well.
But I also want PLAY/PAUSE button and seek bar which will show the progress bar.
My question is that,
is there any inbuilt library or code that I can directly inherit and apply...?
or do I need to create those buttons and seek bar programatically and add them on view while playing the file...?
Thanks in advance.
I tried to search but all shows AVAudioPlayer working,
Nothing found four PLAY/PAUSE buttons additions
I am currently making a music player, and I made my own control view using UIButtons for Play, Pause, Next, Previous, and a UISlider for seeking. There is no built in AvAudioPlayer controls that I know of for this purpose.

DirectShow Filter to grab a specific window

I saw another question that sounds almost the same but the answers seem to be about whole desktop screen capture: DirectShow Source filter using Dekstop window as source.
I have looked at the PushSource and yes it does what it is meant to do, however I want the virtual webcam to grab a specific window (similar to how you can select to share a window in Skype's share screen).
How would I go about selecting a specific window as a capture for the virtual webcam? is there a specific method already in the DirectShow API that I don't know about that does this?
There is no specific method. Moreover the part of the sample that grabs from screen is already outside of DirectShow API, it is GDI instead.
So the solution is pretty simple, you GetWindowRect position of your window, and then grab from screen only this rectangle, not the whole desktop. Or instead, you can send WM_PAINT or WM_PRINTCLIENT to the window in order to request its paint into provided device context.

VLC like control panel in Cocoa

I'm writting a video player application (using AVFoundation) for MacOS X and I would like to have the same kind of control panel than VLC (fading out after a few second).
What is the best option to implement this?
I'm thinking about a custom NSWindowControl object that I could design separately with the interface builder but I don't understand very well how to sequence the creation and display step, but I was wondering if there was a best option subclassing a NSViewController...
I simply add a NSPanel in the interface builder, add it as a child window from my main window and add a notification when the main window resize to resize the panel accordingly.

Creating white fade in and out between QT Movies for Cocoa App

I'm trying to achieve a certain effect in Cocoa application. I have several QT movies and a window with buttons that each link to a different movie, and play that movie in the main window. Pretty simple. The problem is I'd like to have a white fade come in and out (more of a flash, really) when the main window switches movies. I'm stuck on how to proceed. I noticed that there is a library for Cocoa called Core Image which can supposedly be used to create visual effects for movies, but is that the best way to proceed? Or is there a simpler way in the QTKit? Thank you!
Actually I just figured this out. I can adjust the alpha levels--> Change Alpha on Main Window - Cocoa

Resources