chef 3746 Posted February 27, 2015 Share Posted February 27, 2015 I figured what the hell.. I'll go another round with my old friend ."Net". The people want lights to dim when a movie starts playing through Media Browser. That's not very hard. But attaching Event Arguments seems to be hard... what am I doing wrong here? 1. I implemeted all the members that the IServerEvents Interface has to offer 2. I turned on Playback Notifications in the Server? I should get a msgbox when playback starts. here is my code if someone has a moment: Imports MediaBrowser.Model.Entities Imports MediaBrowser.Model.Dto Imports MediaBrowser.Model.Events Imports MediaBrowser.Model.ApiClient Imports MediaBrowser.Common.Configuration Imports MediaBrowser.Common.Plugins Imports MediaBrowser.Model.Serialization Imports MediaBrowser.Model.Tasks Imports MediaBrowser.Model.Updates Imports MediaBrowser.Model.Plugins Imports MediaBrowser.Model.Session Imports MediaBrowser.Model.Sync Public Class Plugin Inherits BasePlugin(Of PluginConfiguration) Implements IServerEvents Public Sub New(ByVal applicationPaths As IApplicationPaths, ByVal xmlSerializer As IXmlSerializer) MyBase.New(applicationPaths, xmlSerializer) AddHandler PlaybackStart, AddressOf PlaybackJustStarted End Sub Private Shared Sub PlaybackJustStarted(sender As Object, e As GenericEventArgs(Of SessionInfoDto)) MsgBox(e.Argument.DeviceName) MsgBox("Playback started") End Sub #Region "Properties" Public Overrides ReadOnly Property Name() As String Get Return "Test" End Get End Property #End Region Public Event UserDeleted As EventHandler(Of GenericEventArgs(Of String)) Implements IServerEvents.UserDeleted Public Event ScheduledTaskEnded As EventHandler(Of GenericEventArgs(Of TaskResult)) Implements IServerEvents.ScheduledTaskEnded Public Event PackageInstalling As EventHandler(Of GenericEventArgs(Of InstallationInfo)) Implements IServerEvents.PackageInstalling Public Event PackageInstallationFailed As EventHandler(Of GenericEventArgs(Of InstallationInfo)) Implements IServerEvents.PackageInstallationFailed Public Event PackageInstallationCompleted As EventHandler(Of GenericEventArgs(Of InstallationInfo)) Implements IServerEvents.PackageInstallationCompleted Public Event PackageInstallationCancelled As EventHandler(Of GenericEventArgs(Of InstallationInfo)) Implements IServerEvents.PackageInstallationCancelled Public Event UserUpdated As EventHandler(Of GenericEventArgs(Of UserDto)) Implements IServerEvents.UserUpdated Public Event PluginUninstalled As EventHandler(Of GenericEventArgs(Of PluginInfo)) Implements IServerEvents.PluginUninstalled Public Event LibraryChanged As EventHandler(Of GenericEventArgs(Of LibraryUpdateInfo)) Implements IServerEvents.LibraryChanged Public Event BrowseCommand As EventHandler(Of GenericEventArgs(Of BrowseRequest)) Implements IServerEvents.BrowseCommand Public Event PlayCommand As EventHandler(Of GenericEventArgs(Of PlayRequest)) Implements IServerEvents.PlayCommand Public Event PlaystateCommand As EventHandler(Of GenericEventArgs(Of PlaystateRequest)) Implements IServerEvents.PlaystateCommand Public Event MessageCommand As EventHandler(Of GenericEventArgs(Of MessageCommand)) Implements IServerEvents.MessageCommand Public Event GeneralCommand As EventHandler(Of GenericEventArgs(Of GeneralCommandEventArgs)) Implements IServerEvents.GeneralCommand Public Event NotificationAdded As EventHandler(Of EventArgs) Implements IServerEvents.NotificationAdded Public Event NotificationUpdated As EventHandler(Of EventArgs) Implements IServerEvents.NotificationUpdated Public Event NotificationsMarkedRead As EventHandler(Of EventArgs) Implements IServerEvents.NotificationsMarkedRead Public Event ServerRestarting As EventHandler(Of EventArgs) Implements IServerEvents.ServerRestarting Public Event ServerShuttingDown As EventHandler(Of EventArgs) Implements IServerEvents.ServerShuttingDown Public Event SendStringCommand As EventHandler(Of GenericEventArgs(Of String)) Implements IServerEvents.SendStringCommand Public Event SetVolumeCommand As EventHandler(Of GenericEventArgs(Of Integer)) Implements IServerEvents.SetVolumeCommand Public Event SetAudioStreamIndexCommand As EventHandler(Of GenericEventArgs(Of Integer)) Implements IServerEvents.SetAudioStreamIndexCommand Public Event SetSubtitleStreamIndexCommand As EventHandler(Of GenericEventArgs(Of Integer)) Implements IServerEvents.SetSubtitleStreamIndexCommand Public Event SessionsUpdated As EventHandler(Of GenericEventArgs(Of SessionUpdatesEventArgs)) Implements IServerEvents.SessionsUpdated Public Event RestartRequired As EventHandler(Of EventArgs) Implements IServerEvents.RestartRequired Public Event UserDataChanged As EventHandler(Of GenericEventArgs(Of UserDataChangeInfo)) Implements IServerEvents.UserDataChanged Public Event PlaybackStart As EventHandler(Of GenericEventArgs(Of SessionInfoDto)) Implements IServerEvents.PlaybackStart Public Event PlaybackStopped As EventHandler(Of GenericEventArgs(Of SessionInfoDto)) Implements IServerEvents.PlaybackStopped Public Event SessionEnded As EventHandler(Of GenericEventArgs(Of SessionInfoDto)) Implements IServerEvents.SessionEnded Public Event SyncJobCreated As EventHandler(Of GenericEventArgs(Of SyncJobCreationResult)) Implements IServerEvents.SyncJobCreated Public Event SyncJobCancelled As EventHandler(Of GenericEventArgs(Of SyncJob)) Implements IServerEvents.SyncJobCancelled Public Event SyncJobsUpdated As EventHandler(Of GenericEventArgs(Of List(Of SyncJob))) Implements IServerEvents.SyncJobsUpdated Public Event SyncJobUpdated As EventHandler(Of GenericEventArgs(Of CompleteSyncJobInfo)) Implements IServerEvents.SyncJobUpdated End Class 1 Link to comment Share on other sites More sharing options...
Luke 37099 Posted February 27, 2015 Share Posted February 27, 2015 no, that's for apiclient users only Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now