diff options
Diffstat (limited to 'indra/media_plugins')
-rw-r--r-- | indra/media_plugins/libvlc/media_plugin_libvlc.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp index a5d8f885fd..8ae9931dd4 100644 --- a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp +++ b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp @@ -294,6 +294,15 @@ void MediaPluginLibVLC::eventCallbacks(const libvlc_event_t* event, void* ptr) } } break; + case libvlc_MediaMetaChanged: + 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 +357,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); |