Пример #1
0
        private void UpdateMediaInfo(uBaseObject mediaInfo, TRANSPORTSTATE state)
        {
            TransportState = state;

            var previousMediaInfo = CurrentMediaInfo;

            CurrentMediaInfo = mediaInfo;

            if (previousMediaInfo == null && mediaInfo != null)
            {
                if (state != TRANSPORTSTATE.STOPPED)
                {
                    OnPlaybackStart(mediaInfo);
                }
            }
            else if (mediaInfo != null && previousMediaInfo != null && !mediaInfo.Equals(previousMediaInfo))
            {
                OnMediaChanged(previousMediaInfo, mediaInfo);
            }
            else if (mediaInfo == null && previousMediaInfo != null)
            {
                OnPlaybackStop(previousMediaInfo);
            }
            else if (mediaInfo != null && mediaInfo.Equals(previousMediaInfo))
            {
                OnPlaybackProgress(mediaInfo);
            }
        }
Пример #2
0
        private void UpdateMediaInfo(uBaseObject mediaInfo, TRANSPORTSTATE state)
        {
            TransportState = state;

            var previousMediaInfo = _lastMediaInfo;

            _lastMediaInfo = mediaInfo;

            if (previousMediaInfo == null && mediaInfo != null)
            {
                OnPlaybackStart(mediaInfo);
            }
            else if (mediaInfo == null && previousMediaInfo != null)
            {
                OnPlaybackStop(previousMediaInfo);
            }
            else if (mediaInfo != null && mediaInfo.Equals(previousMediaInfo))
            {
                OnPlaybackProgress(mediaInfo);
            }
        }
Пример #3
0
        private void UpdateMediaInfo(uBaseObject mediaInfo, TRANSPORTSTATE state)
        {
            TransportState = state;

            var previousMediaInfo = CurrentMediaInfo;
            CurrentMediaInfo = mediaInfo;

            if (previousMediaInfo == null && mediaInfo != null)
            {
                if (state != TRANSPORTSTATE.STOPPED)
                {
                    OnPlaybackStart(mediaInfo);
                }
            }
            else if (mediaInfo != null && previousMediaInfo != null && !mediaInfo.Equals(previousMediaInfo))
            {
                OnMediaChanged(previousMediaInfo, mediaInfo);
            }
            else if (mediaInfo == null && previousMediaInfo != null)
            {
                OnPlaybackStop(previousMediaInfo);
            }
            else if (mediaInfo != null && mediaInfo.Equals(previousMediaInfo))
            {
                OnPlaybackProgress(mediaInfo);
            }
        }