Esempio n. 1
0
        private static void Initialize()
        {
            Native.Create(out _handle).ThrowIfError("Failed to create media controller server.");

            try
            {
                RegisterPlaybackCommandReceivedEvent();
                RegisterPlaybackActionCommandReceivedEvent();
                RegisterPlaybackPositionCommandReceivedEvent();
                RegisterPlaylistCommandReceivedEvent();
                RegisterShuffleModeCommandReceivedEvent();
                RegisterRepeatModeCommandReceivedEvent();
                RegisterCustomCommandReceivedEvent();
                RegisterCommandCompletedEvent();
                RegisterSearchCommandReceivedEvent();

                _isRunning = true;
            }
            catch
            {
                Native.Destroy(_handle);
                _playbackCommandCallback = null;
                _handle = IntPtr.Zero;
                throw;
            }
        }
Esempio n. 2
0
        private static void Initialize()
        {
            Native.Create(out _handle).ThrowIfError("Failed to create media controller server.");

            try
            {
                RegisterPlaybackActionCommandReceivedEvent();
                RegisterPlaybackPositionCommandReceivedEvent();
                RegisterPlaylistCommandReceivedEvent();
                RegisterShuffleModeCommandReceivedEvent();
                RegisterRepeatModeCommandReceivedEvent();
                RegisterSubtitleModeCommandReceivedEvent();
                RegisterMode360CommandReceivedEvent();
                RegisterDisplayModeCommandReceivedEvent();
                RegisterDisplayRotationCommandReceivedEvent();
                RegisterCustomCommandReceivedEvent();
                RegisterCommandCompletedEvent();
                RegisterSearchCommandReceivedEvent();

                _serverName = Application.Current.ApplicationInfo.ApplicationId;
                _isRunning  = true;
            }
            catch
            {
                Native.Destroy(_handle);
                _handle     = IntPtr.Zero;
                _serverName = null;
                throw;
            }
        }
Esempio n. 3
0
        private static void Initialize()
        {
            Native.Create(out _handle).ThrowIfError("Failed to create media controller server.");

            try
            {
                RegisterPlaybackCommandReceivedEvent();
                _isRunning = true;
            }
            catch
            {
                Native.Destroy(_handle);
                _playbackCommandCallback = null;
                _handle = IntPtr.Zero;
                throw;
            }
        }