Ejemplo n.º 1
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
}
Ejemplo n.º 2
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)
}