0

In short, I want to create a simple video player which can play some major video formats like quicktime *.mov, for example. What I need is:

  • video playback (at least the most major formats would be great)
  • play, pause
  • need information about where the movie currently is (how many seconds passed, or how much percent)

I'm targeting the mac, for the beginning. So the preferred technology is Cocoa and Objective-C. But if there's just nothing for that, I could also imagine to do something with Java. Any idea?

Barry Wark
  • 107,306
  • 24
  • 181
  • 206
  • You can also use YouTube API, you can upload and control a YouTube video, although It might not suit your needs. See for instance: http://code.google.com/apis/ajax/playground/#chromeless_player – OscarRyz Sep 17 '09 at 20:09

3 Answers3

12

QTKit is the (built-in) Objective-C framework for developing with QuickTime. It includes QTMovieView and QTMovieLayer, an NSView and CALayer subclass respectively for playing any content that QuickTime understands. Simple playback controls can optionally be provided by these controls for free. Both can be used from Interface Builder, making a media app an almost zero-code affair. The QuickTime Programming Guide will get you started.

You should also check the QTKitPlayer sample code. It can do everything you describe and shows how to integrate all of the QTKit components for a playback-only application (QTKit also supports media capture and editing).

Barry Wark
  • 107,306
  • 24
  • 181
  • 206
  • Since MacOSX Maverick (10.9), QTKit has been deprecated in favor of AVKit. See https://developer.apple.com/av-foundation/ . – FabienAndre Mar 04 '14 at 13:57
0

You can use QuickTime for Java

It's very easy to use.

Here's a snippet:

        QTSession.open();
        String url = "http://......mov";
        DataRef dRef = new DataRef(url);
        Movie mov = Movie.fromDataRef (dRef, StdQTConstants.newMovieActive);
        MoviePlayer player = new MoviePlayer(mov);
        mov.start();
        JComponent qtPlayer = QTFactory.makeQTJComponent(player).asJComponent();

The snipped was taken from the examples from: Timing Framework written by Chet Haase

That sample ( the one from the Timing Framework ) looks like this:

Java quicktime http://img41.imageshack.us/img41/7268/capturadepantalla200909p.png

OscarRyz
  • 196,001
  • 113
  • 385
  • 569
0

If you want to use Java then Java Media Framework or it's open source analog Freedom For Media in Java, will do the job. FMJ has native binding to DirectShow, QuickTime For Java and Gstreamer. It will do everything you need plus a little bit more. And you will not need to worry about which format you're playing.

Denis Tulskiy
  • 19,012
  • 6
  • 50
  • 68