Exemplo n.º 1
0
        /// <summary>
        /// Switches playback to remote AllShare device.
        /// </summary>
        /// <param name="deviceId"> the unique identifier of device </param>
        /// <param name="deviceType"> the device controllerType </param>
        public virtual void setRemotePlayer(string deviceId, int deviceType)
        {
            // Releases previous player.
            if (mControllerType != null)
            {
                mControllerType.release();
            }

            ControllerType previousControllerType = mControllerType;

            // Connects to remote player.
            mControllerType = new RemotePlayer(this, mContentUri, mSubtitlesUri, mMimeType, deviceId, deviceType);
            restorePosition();

            // Releases previous player.
            if (previousControllerType != null)
            {
                previousControllerType.release();
            }
        }
        /// <summary>
        /// Switches playback to remote AllShare device.
        /// </summary>
        /// <param name="deviceId"> the unique identifier of device </param>
        /// <param name="devicetype"> the device type </param>
        public virtual void setRemotePlayer(string deviceId, int devicetype)
        {
            // Release previous player
            if (mControllerType != null)
            {
                mControllerType.release();
            }

            Log.d("MediaPlayer", "setRemotePlayer");

            ControllerType previousControllerType = mControllerType;

            // Connect to remote player
            mControllerType = new RemotePlayer(this, mContentUri, mMimeType, deviceId, devicetype);

            // Restore current state and position
            restorePosition();

            // Releases previous player.
            if (previousControllerType != null)
            {
                previousControllerType.release();
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Switches playback to local media player.
        /// </summary>
        public virtual void setLocalPlayer()
        {
            if (mControllerType is LocalPlayer)
            {
                // We are already local, do nothing.
                return;
            }

            ControllerType previousControllerType = mControllerType;

            mControllerType = new LocalPlayer(this, mContentUri, mSubtitlesUri, mVideoView);
            restorePosition();

            // Releases previous player.
            if (previousControllerType != null)
            {
                previousControllerType.release();

                // Notify listener
                mEventListener.onRemoteDisconnected();
            }
        }
        /// <summary>
        /// Switches playback to local media player.
        /// </summary>
        public virtual void setLocalPlayer()
        {
            if (mControllerType is LocalPlayer)
            {
                // We are already local, do nothing
                return;
            }

            Log.d("MusicPlayerActivity", "setLocalPlayer");

            ControllerType previousControllerType = mControllerType;

            mControllerType = new LocalPlayer(this, mContentUri);
            restorePosition();

            // Releases previous player.
            if (previousControllerType != null)
            {
                previousControllerType.release();

                // Notify listener
                mEventListener.onRemoteDisconnected();
            }
        }