Example #1
0
// SetMedia sets the new media to be used by this player. If existing media is
// loaded, it will be destroyed.
func (this *Player) SetMedia(m *Media) error {
	if this.ptr == nil || m.ptr == nil {
		return syscall.EINVAL
	}

	C.libvlc_media_player_set_media(this.ptr, m.ptr)
	return checkError()
}
Example #2
0
// SetMedia sets the new media to be used by this player. If existing media is
// loaded, it will be destroyed.
func (this *Player) SetMedia(m *Media) error {
	if this.ptr == nil || m.ptr == nil {
		return &VLCError{"Player is nil"}
	}

	C.libvlc_media_player_set_media(this.ptr, m.ptr)
	return checkError()
}
Example #3
0
func (p *Player) SetMedia(path string, local bool) error {
	if p.player == nil {
		return errors.New("A player must first be initialized")
	}

	if p.media != nil {
		if err := p.media.Release(); err != nil {
			return err
		}

		p.media = nil
	}

	media, err := newMedia(path, local)
	if err != nil {
		return err
	}

	p.media = media
	C.libvlc_media_player_set_media(p.player, media.media)

	return getError()
}
Example #4
0
func (p *Player) SetMedia(media *Media) {
	C.libvlc_media_player_set_media(p.instance, (*C.struct_libvlc_media_t)(media))
}