New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add: Video capability for MCMP and Lua API #6439
base: development
Are you sure you want to change the base?
Conversation
Improve: StickMUD default listing to secure port
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
No need to install anything - just unzip and run. |
/refresh links |
mudlet.org was having difficulties and I suspect the snapshots might not have been uploaded. |
Really great stuff as usual! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that the Video player is associated with a particular profile you also need to add a single line of code to enable/disable the Video player main toolbar button in:
(void) mudlet::disableToolbarButtons()
(void) mudlet::enableToolbarButtons()
} | ||
|
||
if (!pM->isVisible()) { | ||
return {false, qsl("video player widget already closed")}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this counts as a warning - unlike the mapper I do not know whether it is possible to completely remove an extant "video player" whereas we only ever hide (but do not destroy) the mapper (which causes other issues if the user wishes to change from one embedded in a console to a floating/dockable one - as it cannot be done without closing the profile - which I would not like to see replicated in this new feature...!)
src/TVideoPlayer.cpp
Outdated
@@ -0,0 +1,24 @@ | |||
/*************************************************************************** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is currently redundant - the trivial constructor can be placed within the header file (src/TVideoPlayer.h
) as is the case with some other classes...
Co-authored-by: Stephen Lyons <slysven@virginmedia.com>
These exist I believe: mpActionVideoPlayer |
Yeah - I think I missed them when I was looking through the changes, sorry about that. |
It's not immediately obvious as to why the mac build failed. Rebuilding... |
Could you add some examples of how to use the APIs? We'll need those for documentation in the end too. I tried playing around with the PR but didn't have any luck, documenting my beginners journey -
I noticed that if you use Need to also add the Video option to the menu bar, as some play with the toolbar off for bigger screen real estate: |
Like sound and music, the loadXYZFile() functions are for preloading media in the background so it is ready to use for a future playXYZFile() function later. It downloads the file and puts it in the cache. |
Coming from a perspective of a non-techie, do you think the I am wondering if we should be showing the button until there's been a video played or until there's more controls in the widget to load & play videos on your own. |
OK, now the button and shortcuts will not be enabled until the video UI is generated by MCMP, API, or the user putting a Geyser.VideoPlayer into their UI. |
Found that an undocked and floating video when playing and is closed before it quits playing will also cause the segmentation fault. |
Aligned the syntax of playVideoFile() with playSoundFile() and playMusicFile(). These are documented on Area 51. I added a key/value pair of |
My suspicion is that something is wrong with widget parenting. On my machine, there was an infinite loop of window creation in the stacktrace. |
This code isn't playing the video and there's no obvious errors, what could be wrong?
|
Note some changes in the API mentioned top of the GitHub PR and you must use play to play (load is just to download). lua playVideoFile({name = "TextInMotion-VideoSample-1080p.mp4", url = "https://d2qguwbxlx1sbt.cloudfront.net/"}) |
I am working on this by the way, coming soon - doing a refactor so that we could run a video in the Mudlet scope too, not just in the profile scope. Hopefully I will work my way out of the segment faults this way too. More to come... |
This code will be refactored in with the Qt6 updates for Mudlet multimedia. |
Have you got the original code to push to a branch btw? It is not in https://github.com/mpconley/Mudlet/branches |
No, it was on a computer that died and I blew away the old branches when I made the new fork. I'll just reference what is here. Now that QMediaPlaylist is gone, I will be referencing as much of what they've done in the QT6 example as possible so this code will only be a guide. No worries, just iterating :) |
Note to self: When this is picked back up, determine if there is a concept (or reverse concept) here that will help resolve the sometimes crashes when Mudlet closes when video is still playing. |
Brief overview of PR changes/additions
Adding:
Future:
Stream a video
Download/play a video
Stop playing the video
Preload a video to play later
Motivation for adding to Mudlet
To simplify and enhance capability to attract and teach new users to play MUD games, video capability is now available for the MUD Client Media Protocol and Lua APIs of Mudlet.
Other info (issues closed, discussion etc)