示例#1
0
func (p *Player) Play() error {
	ret := C.libvlc_media_player_play(p.instance)
	if ret != 0 {
		return LastError()
	}
	return nil
}
示例#2
0
文件: player.go 项目: jteeuwen/go-vlc
// Play begins playback.
func (this *Player) Play() (err error) {
	if this.ptr == nil {
		return syscall.EINVAL
	}

	if C.libvlc_media_player_play(this.ptr) < 0 {
		err = checkError()
	}

	return
}
示例#3
0
文件: player.go 项目: henrym/go-vlc
// Play begins playback.
func (this *Player) Play() (err error) {
	if this.ptr == nil {
		return &VLCError{"Player is nil"}
	}

	if C.libvlc_media_player_play(this.ptr) < 0 {
		err = checkError()
	}

	return
}
示例#4
0
func (p *Player) Play() error {
	if p.player == nil {
		return errors.New("A player must first be initialized")
	}

	if p.IsPlaying() {
		return nil
	}

	if C.libvlc_media_player_play(p.player) < 0 {
		return getError()
	}

	return nil
}