Esempio n. 1
0
func NewPlayer() (*Player, error) {
	if instance == nil {
		return nil, errors.New("Module must be first initialized")
	}

	if player := C.libvlc_media_player_new(instance); player != nil {
		return &Player{player: player}, nil
	}

	return nil, getError()
}
Esempio n. 2
0
// NewPlayer creates an empty media player object.
func (this *Instance) NewPlayer() (*Player, error) {
	if this.ptr == nil {
		return nil, os.EINVAL
	}

	if c := C.libvlc_media_player_new(this.ptr); c != nil {
		return &Player{c}, nil
	}

	return nil, checkError()
}
Esempio n. 3
0
func (vlc *VLC) NewPlayer() (*Player, error) {
	p := &Player{}
	p.instance = C.libvlc_media_player_new(vlc.instance)
	return p, LastError()
}