diff options
Diffstat (limited to 'indra/media_plugins/libvlc/media_plugin_libvlc.cpp')
-rw-r--r-- | indra/media_plugins/libvlc/media_plugin_libvlc.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp index 4240613a0c..e79d474325 100644 --- a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp +++ b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp @@ -294,6 +294,22 @@ void MediaPluginLibVLC::eventCallbacks(const libvlc_event_t* event, void* ptr) } } break; + case libvlc_MediaMetaChanged: + auto title = libvlc_media_get_meta(parent->mLibVLCMedia, libvlc_meta_Title); + if (title) + { + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "title_text"); + message.setValue("title", title); + parent->sendMessage(message); + } + auto now_playing = libvlc_media_get_meta(parent->mLibVLCMedia, libvlc_meta_NowPlaying); + if (now_playing) + { + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "nowplaying_text"); + message.setValue("nowplaying", now_playing); + parent->sendMessage(message); + } + break; } } @@ -348,6 +364,11 @@ void MediaPluginLibVLC::playMedia() libvlc_event_attach(em, libvlc_MediaPlayerLengthChanged, eventCallbacks, this); libvlc_event_attach(em, libvlc_MediaPlayerTitleChanged, eventCallbacks, this); } + auto event_manager = libvlc_media_event_manager(mLibVLCMedia); + if (event_manager) + { + libvlc_event_attach(event_manager, libvlc_MediaMetaChanged, eventCallbacks, this); + } libvlc_video_set_callbacks(mLibVLCMediaPlayer, lock, unlock, display, &mLibVLCCallbackContext); libvlc_video_set_format(mLibVLCMediaPlayer, "RV32", mWidth, mHeight, mWidth * mDepth); |