2013-05-09 17:38:02 +00:00
|
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
|
using MediaBrowser.Controller.Library;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Session
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interface ISessionManager
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface ISessionManager
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs when [playback start].
|
|
|
|
|
/// </summary>
|
|
|
|
|
event EventHandler<PlaybackProgressEventArgs> PlaybackStart;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs when [playback progress].
|
|
|
|
|
/// </summary>
|
|
|
|
|
event EventHandler<PlaybackProgressEventArgs> PlaybackProgress;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs when [playback stopped].
|
|
|
|
|
/// </summary>
|
|
|
|
|
event EventHandler<PlaybackProgressEventArgs> PlaybackStopped;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2013-05-10 12:18:07 +00:00
|
|
|
|
/// Gets the sessions.
|
2013-05-09 17:38:02 +00:00
|
|
|
|
/// </summary>
|
2013-05-10 12:18:07 +00:00
|
|
|
|
/// <value>The sessions.</value>
|
|
|
|
|
IEnumerable<SessionInfo> Sessions { get; }
|
2013-05-09 17:38:02 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Logs the user activity.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="clientType">Type of the client.</param>
|
2013-07-09 16:11:16 +00:00
|
|
|
|
/// <param name="appVersion">The app version.</param>
|
2013-05-09 17:38:02 +00:00
|
|
|
|
/// <param name="deviceId">The device id.</param>
|
|
|
|
|
/// <param name="deviceName">Name of the device.</param>
|
|
|
|
|
/// <param name="user">The user.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
/// <exception cref="System.ArgumentNullException">user</exception>
|
2013-07-09 16:11:16 +00:00
|
|
|
|
Task<SessionInfo> LogConnectionActivity(string clientType, string appVersion, string deviceId, string deviceName, User user);
|
2013-05-09 17:38:02 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Used to report that playback has started for an item
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
2013-07-09 16:11:16 +00:00
|
|
|
|
/// <param name="sessionId">The session id.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2013-05-09 17:38:02 +00:00
|
|
|
|
/// <exception cref="System.ArgumentNullException"></exception>
|
2013-07-09 16:11:16 +00:00
|
|
|
|
Task OnPlaybackStart(BaseItem item, Guid sessionId);
|
2013-05-09 17:38:02 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Used to report playback progress for an item
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <param name="positionTicks">The position ticks.</param>
|
2013-05-10 12:18:07 +00:00
|
|
|
|
/// <param name="isPaused">if set to <c>true</c> [is paused].</param>
|
2013-07-09 16:11:16 +00:00
|
|
|
|
/// <param name="sessionId">The session id.</param>
|
2013-05-09 17:38:02 +00:00
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
/// <exception cref="System.ArgumentNullException"></exception>
|
2013-08-29 21:00:27 +00:00
|
|
|
|
Task OnPlaybackProgress(BaseItem item, long? positionTicks, bool isPaused, bool isMuted, Guid sessionId);
|
2013-05-09 17:38:02 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Used to report that playback has ended for an item
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <param name="positionTicks">The position ticks.</param>
|
2013-07-09 16:11:16 +00:00
|
|
|
|
/// <param name="sessionId">The session id.</param>
|
2013-05-09 17:38:02 +00:00
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
/// <exception cref="System.ArgumentNullException"></exception>
|
2013-07-09 16:11:16 +00:00
|
|
|
|
Task OnPlaybackStopped(BaseItem item, long? positionTicks, Guid sessionId);
|
2013-05-09 17:38:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|