Author Topic: Video Play Notification  (Read 20083 times)

lamrongol

  • Jr. Member
  • **
  • Posts: 47
Hi.

I am now developing a plugin to play music and music videos continuously in playlist. (play video by vlc with play-and-exit option, and play next track when video play is finished)
https://github.com/lamrongol/MusicBeeVlcVideoPlayPlugin

However, this plugin can't work if a user plays specified video because video play notification doesn't exist(TrackChanged, TrackChanging doesn't work when playing video) and can't stop launching default video player.

Would you add such notification?
Last Edit: March 29, 2014, 03:49:44 PM by tfujikawa

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
i am happy to enhance the API but i need to better understand what you are doing.
When a user plays a video file in MB, it will launch the configured video player such as WMP, VLC etc.
When you plugin is enabled i guess you want MB to not launch the video player but rather notify your plugin in some way?
Can i ask what your plugin will do to add value to this? (I only ask to better understand to better provide you with what you need)

lamrongol

  • Jr. Member
  • **
  • Posts: 47
Sorry for unclear description
When you plugin is enabled i guess you want MB to not launch the video player but rather notify your plugin in some way?
Can i ask what your plugin will do to add value to this? (I only ask to better understand to better provide you with what you need)

On default behavior, MB doesn't play video even if a playlist contains video file. And MB doesn't play next track after launching a video player.

This plugin plays video files when a user plays a playlist including video files and play next track when video play is finished.
These features are possible in current version when a user plays a playlist, however, a plugin can't detect and play a video file when a user plays a specified video file, not playlist.

So I need two features.
-disable default behavior, launching video player
-detect a video file a user intend to play

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
http://musicbee.niblseed.com/V2_4/MusicBee_Exe_Patched.zip
and the updated interface file definition:
http://www.mediafire.com/download/zq6mr986wqa9rp6/MusicBeeInterface.zip

change MinApiRevision to 39 in the MusicBeeInterface file to force users to MB v2.4 to use the plugin

in the Plugin class Initialise() function:
about.Type = PluginType.VideoPlayer;

and create a function as follows:
        public bool PlayVideo(string[] urls)
        {
...your code
            return true;
        }


When MB detects that function in a plugin it will call it instead of invoking an external .exe
Although urls is an array i think with the current MB version it only ever passes one value in the array but i am not completely sure about that

If you are planning to embed the video player inside MB and want to draw it on a panel:
videoPanel = New Panel
videoPanel.Bounds = mbApiInterface.MB_GetPanelBounds(PluginPanelDock.ApplicationWindow)
mbApiInterface.MB_AddPanel(videoPanel, PluginPanelDock.ApplicationWindow)
...
mbApiInterface.MB_RemovePanel(videoPanel)
MB will resize the panel automatically
Last Edit: March 18, 2014, 11:08:51 PM by Steven

lamrongol

  • Jr. Member
  • **
  • Posts: 47
Thank you very much for adding features.

But, I want to apologize for having to ask a favor of you again, could I ask two more features?

1.  I noticed that MB plays video files in playlist when shuffle mode is off and MB doesn't play  when shuffle mode is on.
     Could you make MB play video files when shuffle mode is on, too?

2.  Could you make MB show current playing video file on bottom panel so that a user can operate(e.g. giving star. I 'm going to add a feature to edit tag by taglib-sharp in the future)

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
for 1, by default when a video file is added to the library the "skip when shuffling" flag is set. You can adjust that using the tag editor and i have changed it so it no longer does that for new files added to the video library
for 2, that is done now:
http://musicbee.niblseed.com/V2_4/MusicBee_Exe_Patched.zip

Also i can confirm you will only ever get 1 file in the array for your PlayVideo function

lamrongol

  • Jr. Member
  • **
  • Posts: 47
Thank you! I'll struggle to relase this plugin soon.

Update:
Released
Video Continuous Play plugin (Require MusicBee 2.4 or later) - MusicBee - Forum
http://getmusicbee.com/forum/index.php?topic=12419
Last Edit: March 30, 2014, 03:34:25 AM by tfujikawa

lamrongol

  • Jr. Member
  • **
  • Posts: 47
When video play starts, play state changes to "Stopped".
If it is not difficult, could you make it not changed?

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
i will make a change to accomodate this probably in the next couple of days

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
actually do you really need this? - wouldnt it make more sense to control the playback from VLC. I will do this if you still think its important

lamrongol

  • Jr. Member
  • **
  • Posts: 47
I want to implement a feature to stop playing video when a user clicks stop button. as following topic.

Video Continuous Play plugin (Require MusicBee 2.4 or later) - MusicBee - Forum
http://getmusicbee.com/forum/index.php?topic=12419

But on latest version, "PlayStateChanged" notification doesn't occur  when stop button is clicked.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
it might be a week or two before i can look at this

lamrongol

  • Jr. Member
  • **
  • Posts: 47
Could you tell me whether you will implement or not this feature?

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
sorry - i forgot about this. I am now in the middle of another change so i wont be until next weekend i can look at it

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
i have had a look at this but perhaps i dont understand exactly what you want.
When i click the Stop button in musicbee a notification is sent to plugins "PlayStateChanged"
your plugin should receive that notification asynchronously ie. it might be a few milliseconds after the user has clicked stop.
You can then query the playstate via the musicbee api Player_GetPlayState() which should return a status of Stopped
But i expect you know all of this so have i misunderstood your requirement?