Example #1
0
// SetMeta sets the metadata for this media instance.
// Note: This method does not save the metadata. Call Media.SaveMeta() for this purpose.
func (this *Media) SetMeta(mp MetaProperty, v string) {
	if this.ptr == nil {
		return
	}

	c := C.CString(v)
	C.libvlc_media_set_meta(this.ptr, C.libvlc_meta_t(mp), c)
	C.free(unsafe.Pointer(c))
}
Example #2
0
// Meta reads the specified metadata property of the media.
//
// If the media has not yet been parsed this will return an empty string.
//
// This method automatically calls Media.ParseAsync(), so after calling
// it you may receive a MediaMetaChanged event. If you prefer a synchronous
// version, ensure that you call Media.Parse() before Media.Meta().
func (this *Media) Meta(mp MetaProperty) (s string) {
	if this.ptr == nil {
		return
	}

	if c := C.libvlc_media_get_meta(this.ptr, C.libvlc_meta_t(mp)); c != nil {
		s = C.GoString(c)
		C.free(unsafe.Pointer(c))
	}

	return
}
Example #3
0
func (m *Media) GetMeta(meta Meta) string {
	str := C.libvlc_media_get_meta((*C.struct_libvlc_media_t)(m), C.libvlc_meta_t(meta))
	defer C.free(unsafe.Pointer(str))
	return C.GoString(str)
}