Interface ISessionManager
Interface ISessionManager
Namespace: MediaBrowser.Controller.Session
Assembly: MediaBrowser.Controller.dll
Syntax
public interface ISessionManager
Properties
Sessions
Gets the sessions.
Declaration
IEnumerable<SessionInfo> Sessions { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<SessionInfo> | The sessions. |
Methods
AddAdditionalUser(String, Int64)
Adds the additional user.
Declaration
void AddAdditionalUser(string sessionId, long userId)
Parameters
Type | Name | Description |
---|---|---|
System.String | sessionId | The session identifier. |
System.Int64 | userId | The user identifier. |
AuthenticateNewSession(AuthenticationRequest, CancellationToken)
Authenticates the new session.
Declaration
Task<AuthenticationResult> AuthenticateNewSession(AuthenticationRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
AuthenticationRequest | request | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<AuthenticationResult> |
ClearTranscodingInfo(String, String)
Clears the transcoding information.
Declaration
void ClearTranscodingInfo(string reportedDeviceId, string playSessionId)
Parameters
Type | Name | Description |
---|---|---|
System.String | reportedDeviceId | The device identifier. |
System.String | playSessionId | The play session identifier. |
CloseIfNeeded(SessionInfo)
Declaration
void CloseIfNeeded(SessionInfo session)
Parameters
Type | Name | Description |
---|---|---|
SessionInfo | session |
CreateNewSession(AuthenticationRequest, CancellationToken)
Creates the new session.
Declaration
Task<AuthenticationResult> CreateNewSession(AuthenticationRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
AuthenticationRequest | request | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<AuthenticationResult> |
GetSession(String, String, String)
Gets the session.
Declaration
SessionInfo GetSession(string reportedDeviceId, string client, string version)
Parameters
Type | Name | Description |
---|---|---|
System.String | reportedDeviceId | The device identifier. |
System.String | client | The client. |
System.String | version | The version. |
Returns
Type | Description |
---|---|
SessionInfo | SessionInfo. |
GetSessionByAuthenticationToken(AuthenticationInfo, String, IPAddress, String, String)
Gets the session by authentication token.
Declaration
SessionInfo GetSessionByAuthenticationToken(AuthenticationInfo info, string reportedDeviceId, IPAddress remoteAddress, string protocol, string appVersion)
Parameters
Type | Name | Description |
---|---|---|
AuthenticationInfo | info | The information. |
System.String | reportedDeviceId | The device identifier. |
System.Net.IPAddress | remoteAddress | The remote endpoint. |
System.String | protocol | |
System.String | appVersion | The application version. |
Returns
Type | Description |
---|---|
SessionInfo | Task<SessionInfo>. |
GetSessionByAuthenticationToken(String, String, IPAddress, String)
Gets the session by authentication token.
Declaration
SessionInfo GetSessionByAuthenticationToken(string token, string reportedDeviceId, IPAddress remoteAddress, string protocol)
Parameters
Type | Name | Description |
---|---|---|
System.String | token | The token. |
System.String | reportedDeviceId | The device identifier. |
System.Net.IPAddress | remoteAddress | The remote endpoint. |
System.String | protocol |
Returns
Type | Description |
---|---|
SessionInfo | SessionInfo. |
Logout(AuthenticationInfo)
Declaration
void Logout(AuthenticationInfo authenticationInfo)
Parameters
Type | Name | Description |
---|---|---|
AuthenticationInfo | authenticationInfo |
Logout(String)
Logouts the specified access token.
Declaration
void Logout(string accessToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | accessToken | The access token. |
LogSessionActivity(String, String, Int64, String, String, IPAddress, String, User)
Logs the user activity.
Declaration
SessionInfo LogSessionActivity(string appName, string appVersion, long deviceId, string reportedDeviceId, string deviceName, IPAddress remoteAddress, string protocol, User user)
Parameters
Type | Name | Description |
---|---|---|
System.String | appName | |
System.String | appVersion | |
System.Int64 | deviceId | |
System.String | reportedDeviceId | |
System.String | deviceName | |
System.Net.IPAddress | remoteAddress | |
System.String | protocol | |
User | user |
Returns
Type | Description |
---|---|
SessionInfo |
LogSessionActivity(String, String, String, String, String, User)
Declaration
SessionInfo LogSessionActivity(string appName, string appVersion, string reportedDeviceId, string deviceName, string remoteAddress, User user)
Parameters
Type | Name | Description |
---|---|---|
System.String | appName | |
System.String | appVersion | |
System.String | reportedDeviceId | |
System.String | deviceName | |
System.String | remoteAddress | |
User | user |
Returns
Type | Description |
---|---|
SessionInfo |
OnPlaybackProgress(PlaybackProgressInfo)
Used to report playback progress for an item
Declaration
Task OnPlaybackProgress(PlaybackProgressInfo info)
Parameters
Type | Name | Description |
---|---|---|
PlaybackProgressInfo | info | The info. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
OnPlaybackProgress(PlaybackProgressInfo, SessionInfo)
Declaration
Task OnPlaybackProgress(PlaybackProgressInfo info, SessionInfo sessionInfo)
Parameters
Type | Name | Description |
---|---|---|
PlaybackProgressInfo | info | |
SessionInfo | sessionInfo |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
OnPlaybackProgress(PlaybackProgressInfo, SessionInfo, PlaySessionInfo, Boolean)
Declaration
Task OnPlaybackProgress(PlaybackProgressInfo info, SessionInfo sessionInfo, PlaySessionInfo playSessionInfo, bool isAutomated)
Parameters
Type | Name | Description |
---|---|---|
PlaybackProgressInfo | info | |
SessionInfo | sessionInfo | |
PlaySessionInfo | playSessionInfo | |
System.Boolean | isAutomated |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
OnPlaybackStart(PlaybackStartInfo)
Used to report that playback has started for an item
Declaration
Task OnPlaybackStart(PlaybackStartInfo info)
Parameters
Type | Name | Description |
---|---|---|
PlaybackStartInfo | info | The info. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
OnPlaybackStart(PlaybackStartInfo, SessionInfo)
Declaration
Task OnPlaybackStart(PlaybackStartInfo info, SessionInfo sessionInfo)
Parameters
Type | Name | Description |
---|---|---|
PlaybackStartInfo | info | |
SessionInfo | sessionInfo |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
OnPlaybackStopped(PlaybackStopInfo)
Used to report that playback has ended for an item
Declaration
Task OnPlaybackStopped(PlaybackStopInfo info)
Parameters
Type | Name | Description |
---|---|---|
PlaybackStopInfo | info | The info. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
OnPlaybackStopped(PlaybackStopInfo, SessionInfo)
Declaration
Task OnPlaybackStopped(PlaybackStopInfo info, SessionInfo sessionInfo)
Parameters
Type | Name | Description |
---|---|---|
PlaybackStopInfo | info | |
SessionInfo | sessionInfo |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
OnPlaybackStopped(PlaybackStopInfo, SessionInfo, PlaySessionInfo)
Declaration
Task OnPlaybackStopped(PlaybackStopInfo info, SessionInfo sessionInfo, PlaySessionInfo playSessionInfo)
Parameters
Type | Name | Description |
---|---|---|
PlaybackStopInfo | info | |
SessionInfo | sessionInfo | |
PlaySessionInfo | playSessionInfo |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
PingSession(String, String)
Declaration
void PingSession(string reportedDeviceId, string playSessionId)
Parameters
Type | Name | Description |
---|---|---|
System.String | reportedDeviceId | |
System.String | playSessionId |
RegisterPlaySession(PlaybackStartInfo, SessionInfo)
Declaration
void RegisterPlaySession(PlaybackStartInfo info, SessionInfo session)
Parameters
Type | Name | Description |
---|---|---|
PlaybackStartInfo | info | |
SessionInfo | session |
RemoveAdditionalUser(String, Int64)
Removes the additional user.
Declaration
void RemoveAdditionalUser(string sessionId, long userId)
Parameters
Type | Name | Description |
---|---|---|
System.String | sessionId | The session identifier. |
System.Int64 | userId | The user identifier. |
ReportCapabilities(SessionInfo, ClientCapabilities)
Declaration
void ReportCapabilities(SessionInfo session, ClientCapabilities capabilities)
Parameters
Type | Name | Description |
---|---|---|
SessionInfo | session | |
ClientCapabilities | capabilities |
ReportCapabilities(String, ClientCapabilities)
Reports the capabilities.
Declaration
void ReportCapabilities(string sessionId, ClientCapabilities capabilities)
Parameters
Type | Name | Description |
---|---|---|
System.String | sessionId | The session identifier. |
ClientCapabilities | capabilities | The capabilities. |
ReportNowViewingItem(String, BaseItemDto)
Reports the now viewing item.
Declaration
void ReportNowViewingItem(string sessionId, BaseItemDto item)
Parameters
Type | Name | Description |
---|---|---|
System.String | sessionId | The session identifier. |
BaseItemDto | item | The item. |
ReportNowViewingItem(String, String)
Reports the now viewing item.
Declaration
void ReportNowViewingItem(string sessionId, string itemId)
Parameters
Type | Name | Description |
---|---|---|
System.String | sessionId | The session identifier. |
System.String | itemId | The item identifier. |
ReportRemoteControlDisconnectedIfNeeded(SessionInfo)
Declaration
void ReportRemoteControlDisconnectedIfNeeded(SessionInfo session)
Parameters
Type | Name | Description |
---|---|---|
SessionInfo | session |
ReportSessionEnded(String)
Reports the session ended.
Declaration
void ReportSessionEnded(string sessionId)
Parameters
Type | Name | Description |
---|---|---|
System.String | sessionId | The session identifier. |
ReportTranscodingInfo(String, String, TranscodingInfo)
Reports the transcoding information.
Declaration
void ReportTranscodingInfo(string reportedDeviceId, string playSessionId, TranscodingInfo info)
Parameters
Type | Name | Description |
---|---|---|
System.String | reportedDeviceId | The device identifier. |
System.String | playSessionId | The play session identifier. |
TranscodingInfo | info | The information. |
RevokeToken(String)
Revokes the token.
Declaration
void RevokeToken(string id)
Parameters
Type | Name | Description |
---|---|---|
System.String | id |
RevokeUserTokens(Int64, String)
Revokes the user tokens.
Declaration
void RevokeUserTokens(long userId, string currentAccessToken)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | userId | |
System.String | currentAccessToken |
SendBrowseCommand(String, String, BrowseRequest, CancellationToken)
Sends the browse command.
Declaration
Task SendBrowseCommand(string controllingSessionId, string sessionId, BrowseRequest command, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | controllingSessionId | The controlling session identifier. |
System.String | sessionId | The session id. |
BrowseRequest | command | The command. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
SendGeneralCommand(String, String, GeneralCommand, CancellationToken)
Sends the general command.
Declaration
Task SendGeneralCommand(string controllingSessionId, string sessionId, GeneralCommand command, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | controllingSessionId | The controlling session identifier. |
System.String | sessionId | The session identifier. |
GeneralCommand | command | The command. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
SendMessageCommand(String, String, MessageCommand, CancellationToken)
Sends the message command.
Declaration
Task SendMessageCommand(string controllingSessionId, string sessionId, MessageCommand command, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | controllingSessionId | The controlling session identifier. |
System.String | sessionId | The session id. |
MessageCommand | command | The command. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
SendMessageToAdminSessions<T>(String, T, CancellationToken)
Sends the message to admin sessions.
Declaration
Task SendMessageToAdminSessions<T>(string name, T data, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name. |
T | data | The data. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
Type Parameters
Name | Description |
---|---|
T |
SendMessageToUserDeviceAndAdminSessions<T>(String, String, T, CancellationToken)
Declaration
Task SendMessageToUserDeviceAndAdminSessions<T>(string reportedDeviceId, string name, T data, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | reportedDeviceId | |
System.String | name | |
T | data | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Type Parameters
Name | Description |
---|---|
T |
SendMessageToUserDeviceSessions<T>(String, String, T, CancellationToken)
Sends the message to user device sessions.
Declaration
Task SendMessageToUserDeviceSessions<T>(string reportedDeviceId, string name, T data, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | reportedDeviceId | The device identifier. |
System.String | name | The name. |
T | data | The data. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
Type Parameters
Name | Description |
---|---|
T |
SendMessageToUserSessions<T>(Int64[], String, T, CancellationToken)
Sends the message to user sessions.
Declaration
Task SendMessageToUserSessions<T>(long[] userIds, string name, T data, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Int64[] | userIds | |
System.String | name | |
T | data | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
Type Parameters
Name | Description |
---|---|
T |
SendMessageToUserSessions<T>(Int64[], String, Func<T>, CancellationToken)
Declaration
Task SendMessageToUserSessions<T>(long[] userIds, string name, Func<T> dataFn, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Int64[] | userIds | |
System.String | name | |
System.Func<T> | dataFn | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Type Parameters
Name | Description |
---|---|
T |
SendPlayCommand(String, String, PlayRequest, CancellationToken)
Sends the play command.
Declaration
Task SendPlayCommand(string controllingSessionId, string sessionId, PlayRequest command, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | controllingSessionId | The controlling session identifier. |
System.String | sessionId | The session id. |
PlayRequest | command | The command. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
SendPlaystateCommand(String, String, PlaystateRequest, CancellationToken)
Sends the playstate command.
Declaration
Task SendPlaystateCommand(string controllingSessionId, string sessionId, PlaystateRequest command, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | controllingSessionId | The controlling session identifier. |
System.String | sessionId | The session id. |
PlaystateRequest | command | The command. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
SendRestartRequiredNotification(CancellationToken)
Sends the restart required message.
Declaration
Task SendRestartRequiredNotification(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
SendServerRestartNotification(CancellationToken)
Sends the server restart notification.
Declaration
Task SendServerRestartNotification(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
SendServerShutdownNotification(CancellationToken)
Sends the server shutdown notification.
Declaration
Task SendServerShutdownNotification(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
UpdateDeviceName(String, String)
Declaration
void UpdateDeviceName(string sessionId, string reportedDeviceName)
Parameters
Type | Name | Description |
---|---|---|
System.String | sessionId | |
System.String | reportedDeviceName |
Events
AuthenticationFailed
Occurs when [authentication failed].
Declaration
event EventHandler<GenericEventArgs<AuthenticationRequest>> AuthenticationFailed
Event Type
Type | Description |
---|---|
System.EventHandler<GenericEventArgs<AuthenticationRequest>> |
AuthenticationSucceeded
Occurs when [authentication succeeded].
Declaration
event EventHandler<GenericEventArgs<AuthenticationResult>> AuthenticationSucceeded
Event Type
Type | Description |
---|---|
System.EventHandler<GenericEventArgs<AuthenticationResult>> |
CapabilitiesChanged
Occurs when [capabilities changed].
Declaration
event EventHandler<SessionEventArgs> CapabilitiesChanged
Event Type
Type | Description |
---|---|
System.EventHandler<SessionEventArgs> |
PlaybackProgress
Occurs when [playback progress].
Declaration
event EventHandler<PlaybackProgressEventArgs> PlaybackProgress
Event Type
Type | Description |
---|---|
System.EventHandler<PlaybackProgressEventArgs> |
PlaybackStart
Occurs when [playback start].
Declaration
event EventHandler<PlaybackProgressEventArgs> PlaybackStart
Event Type
Type | Description |
---|---|
System.EventHandler<PlaybackProgressEventArgs> |
PlaybackStopped
Occurs when [playback stopped].
Declaration
event EventHandler<PlaybackStopEventArgs> PlaybackStopped
Event Type
Type | Description |
---|---|
System.EventHandler<PlaybackStopEventArgs> |
RemoteControlDisconnected
Declaration
event EventHandler<SessionEventArgs> RemoteControlDisconnected
Event Type
Type | Description |
---|---|
System.EventHandler<SessionEventArgs> |
SessionActivity
Declaration
event EventHandler<SessionEventArgs> SessionActivity
Event Type
Type | Description |
---|---|
System.EventHandler<SessionEventArgs> |
SessionEnded
Occurs when [session ended].
Declaration
event EventHandler<SessionEventArgs> SessionEnded
Event Type
Type | Description |
---|---|
System.EventHandler<SessionEventArgs> |
SessionStarted
Occurs when [session started].
Declaration
event EventHandler<SessionEventArgs> SessionStarted
Event Type
Type | Description |
---|---|
System.EventHandler<SessionEventArgs> |