예제 #1
0
파일: player.go 프로젝트: jteeuwen/go-vlc
// SetNSObject sets the NSView handler where the media player should render its
// video output.
//
// Use the vout called "macosx".
//
// The drawable is an NSObject that follow the VLCOpenGLVideoViewEmbedding
// protocol:
//
//     @protocol VLCOpenGLVideoViewEmbedding <NSObject>
//     - (void)addVoutSubview:(NSView *)view;
//     - (void)removeVoutSubview:(NSView *)view;
//     @end
//
// Or it can be an NSView object.
//
// If you want to use it along with Qt4 see the QMacCocoaViewContainer. Then
// the following code should work:
//
//     NSView *video = [[NSView alloc] init];
//     QMacCocoaViewContainer *container = new QMacCocoaViewContainer(video, parent);
//     libvlc_media_player_set_nsobject(mp, video);
//     [video release];
//
// You can find a live example in VLCVideoView in VLCKit.framework.
func (this *Player) SetNSObject(drawable uintptr) (err error) {
	if this.ptr == nil {
		return syscall.EINVAL
	}

	C.libvlc_media_player_set_nsobject(this.ptr, unsafe.Pointer(drawable))
	return
}
예제 #2
0
파일: player.go 프로젝트: henrym/go-vlc
// SetNSObject sets the NSView handler where the media player should render its
// video output.
//
// Use the vout called "macosx".
//
// The drawable is an NSObject that follow the VLCOpenGLVideoViewEmbedding
// protocol:
//
//     @protocol VLCOpenGLVideoViewEmbedding <NSObject>
//     - (void)addVoutSubview:(NSView *)view;
//     - (void)removeVoutSubview:(NSView *)view;
//     @end
//
// Or it can be an NSView object.
//
// If you want to use it along with Qt4 see the QMacCocoaViewContainer. Then
// the following code should work:
//
//     NSView *video = [[NSView alloc] init];
//     QMacCocoaViewContainer *container = new QMacCocoaViewContainer(video, parent);
//     libvlc_media_player_set_nsobject(mp, video);
//     [video release];
//
// You can find a live example in VLCVideoView in VLCKit.framework.
func (this *Player) SetNSObject(drawable uintptr) (err error) {
	if this.ptr == nil {
		return &VLCError{"Player is nil"}
	}

	C.libvlc_media_player_set_nsobject(this.ptr, unsafe.Pointer(drawable))
	return
}