// Open the Media public override UAVPError OpenMedia(string URI, UAVPMediaType mediaType) { Debug.Log("[UAVPlayer_Play] URL[" + URI + "]"); UAVPError error = UAVPError.UAVP_ERROR_NONE; if (CanOutputToTexture(URI)) { error = UAVP_OpenVideo(URI, mediaType); if (error == UAVPError.UAVP_ERROR_NONE) { if (autoplay) { _status = UAVPStatus.UAVP_START; } else { _status = UAVPStatus.UAVP_OPEN; } } else { _status = UAVPStatus.UAVP_NONE; } } else { error = UAVPError.UAVP_Error_OPENFAILED; _status = UAVPStatus.UAVP_NONE; } return(error); }
// Release the Player public override void Release() { Debug.Log("[UAVPlayer_Release]"); UAVPError error = UAVP_ReleasePlayer(); if (error == UAVPError.UAVP_ERROR_NONE) { _status = UAVPStatus.UAVP_RELEASE; } else { _status = UAVPStatus.UAVP_RELEASE; } }
// Start to media playback public override void Start() { Debug.Log("[UAVPlayer_Start]"); UAVPError error = UAVP_PlayVideo(); if (error == UAVPError.UAVP_ERROR_NONE) { _status = UAVPStatus.UAVP_START; } else { _status = UAVPStatus.UAVP_NONE; } }
// Initialize the Media Player public override UAVPError InitPlayer(UAVPLogLevel logLevel) { UAVPError error = UAVP_InitPlayer(); UAVP_setUAVPTimeListener(new uavplayerTimeDelegate(UAVPTimeListener)); if (error == UAVPError.UAVP_ERROR_NONE) { _status = UAVPStatus.UAVP_INIT; } else { _status = UAVPStatus.UAVP_NONE; } return(error); }
// Pause the Player public override void Pause() { Debug.Log("[UAVPlayer_Pause]"); if (videoReady) { UAVPError error = UAVP_PauseVideo(); if (error == UAVPError.UAVP_ERROR_NONE) { _status = UAVPStatus.UAVP_PAUSE; } else { _status = UAVPStatus.UAVP_NONE; } } }