summaryrefslogtreecommitdiff
path: root/indra/llplugin
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-08-22 17:24:02 +0800
committerErik Kundiman <erik@megapahit.org>2024-08-22 17:24:02 +0800
commit78c6c73770202cedcc92d4b19bccd4ffe9075bef (patch)
tree707c74228e50847ff4bcc5669d76981ff7a70601 /indra/llplugin
parent1bc3c10bed75272dbe9137609048a1aa7c678ffe (diff)
Stream notification
https://megapahit.com/show_bug.cgi?id=56 I could make such metadata setting triggered by an event only on the media plugin's side, not on the viewer's side. I had tried adding a MEDIA_EVENT_NOWPLAYING_CHANGED and hoped that mediactrl, viewerparcelmedia, or viewermedia would react to it, but no, so this is the best I could come up with for now, to keep checking if what's now playing has been updated or not. I intentionally didn't clear mNowPlaying the way mURL is, so that it wouldn't notify one last double after the player stops streaming. mNowPlaying and mMediaNowPlaying need to be kept in their last states so that the comparison is correct. I also intentionally didn't put the notification inside the MEDIA_PLAYING scope, cause the flow somehow never got into that scope.
Diffstat (limited to 'indra/llplugin')
-rw-r--r--indra/llplugin/llpluginclassmedia.cpp4
-rw-r--r--indra/llplugin/llpluginclassmedia.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp
index 453223b43e..2da24adbf7 100644
--- a/indra/llplugin/llpluginclassmedia.cpp
+++ b/indra/llplugin/llpluginclassmedia.cpp
@@ -1211,6 +1211,10 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message)
mMediaName = message.getValue("name");
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_NAME_CHANGED);
}
+ else if(message_name == "nowplaying_text")
+ {
+ mMediaNowPlaying = message.getValue("nowplaying");
+ }
else if(message_name == "pick_file")
{
mIsMultipleFilePick = message.getValueBoolean("multiple_files");
diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h
index 5d2f3bbb79..109f3880c5 100644
--- a/indra/llplugin/llpluginclassmedia.h
+++ b/indra/llplugin/llpluginclassmedia.h
@@ -311,6 +311,7 @@ public:
const std::string& getMediaName() const { return mMediaName; };
+ const std::string& getMediaNowPlaying() const { return mMediaNowPlaying; };
std::string getMediaDescription() const { return mMediaDescription; };
// Crash the plugin. If you use this outside of a testbed, you will be punished.
@@ -428,6 +429,7 @@ protected:
bool mCanPaste;
std::string mMediaName;
+ std::string mMediaNowPlaying;
std::string mMediaDescription;
LLColor4 mBackgroundColor;