* @return The current position of the player in milliseconds
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_STATE This instance is in an invalid state for this method.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
+ * @remarks
+ * - The specific error code can be accessed using the GetLastResult() method.
+ * - This method returns -1 when the method failed.
* @see SeekTo()
*/
long GetPosition(void) const;
* @exception E_INVALID_STATE This instance is in an invalid state for this method.
* @remarks The specific error code can be accessed using the GetLastResult() method. @n
* While playing live streaming, this operation returns @c 0.
- * @remarks This method is valid in the @c PLAYER_STATE_OPENED @c PLAYER_STATE_PLAYING @c PLAYER_STATE_PAUSED @c PLAYER_STATE_STOPPED states of this instance.
+ * @remarks
+ * - This method is valid in the @c PLAYER_STATE_OPENED @c PLAYER_STATE_PLAYING @c PLAYER_STATE_PAUSED @c PLAYER_STATE_STOPPED states of this instance.
+ * - This method returns -1 when the method failed.
* @see GetPosition()
*/
long GetDuration(void) const;
* @remarks This method constructs the %Player instance to render the video content into the video texture area.
*/
result Construct(IPlayerEventListener& listener, Tizen::Graphics::Opengl::VideoTexture& videoTexture);
+
+ /**
+ * Gets the current downloading progress of HTTP streaming playback in percent.
+ *
+ * @since 2.1
+ *
+ * @return The current position in percent
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_OPERATION The method works for HTTP streaming playback only.
+ * @exception E_INVALID_STATE This instance is in an invalid state for this method.
+ * @remarks
+ * - This method works only for the @c PLAYER_STATE_PLAYING or PLAYER_STATE_PAUSED states of the %Player instance.
+ * - This method is not supported in HTTP Live Streaming.
+ * - The specific error code can be accessed using GetLastResult() method.
+ * - This method returns -1 when the method failed.
+ */
+ int GetHttpStreamingDownloadProgress(void) const;
+
private:
/**
* The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
__pPlayerImpl->SetProgressiveDownloadIntervalByPercent(percent);
}
+int
+Player::GetHttpStreamingDownloadProgress(void) const
+{
+ int curPosition = -1; //MEDIA_INVALID_VALUE;
+ ClearLastResult();
+
+ SysAssertf(__pPlayerImpl != null, "Not yet constructed! Construct() should be called before use");
+
+ curPosition = __pPlayerImpl->GetHttpStreamingDownloadProgress();
+ return curPosition;
+}
+
}} // Tizen::Media
, __isMuted(false)
, __isLooped(false)
, __isLocalData(true)
- , __isAsync(false)
, __checkCallbackForReadyState(false)
, __isStreamingContent(false)
, __videoEventCreated(false)
, __isProgressiveContent(false)
, __isProgressiveTimerStarted(false)
, __interruptFlag(false)
+ , __isAsync(false)
{
}
}
}
+int
+_PlayerImpl::GetHttpStreamingDownloadProgress(void) const
+{
+ int returnValue = 0;
+ int startValue = 0;
+ int err = ::PLAYER_ERROR_NONE;
+ player_state_e corePlayerCurState;
+ result r = E_SUCCESS;
+
+ SysAssertf(__hPlayer != null, "Not yet constructed! Construct() should be called before use");
+
+ SysTryReturn(NID_MEDIA, __isStreamingContent == true, -1, E_INVALID_OPERATION, "[%s] Failed to perform this operation. This method dose not work on local content.", GetErrorMessage(E_INVALID_OPERATION));
+
+ err = player_get_state(__hPlayer, &corePlayerCurState);
+ r = MapExceptionToResult(err);
+ SysTryReturn(NID_MEDIA, r == E_SUCCESS, -1, r, "[%s] Failed to perform player_getstate operation with - 0x%x", GetErrorMessage(r), err);
+
+ SysTryReturn(NID_MEDIA, (corePlayerCurState == ::PLAYER_STATE_PLAYING) || (corePlayerCurState == ::PLAYER_STATE_PAUSED) ,
+ -1, E_INVALID_STATE, "[E_INVALID_STATE] Player state is in an invalid state. Current state is %d", corePlayerCurState);
+
+ err = player_get_streaming_download_progress(__hPlayer, &startValue, &returnValue);
+ r = MapExceptionToResult(err);
+ SysTryReturn(NID_MEDIA, r == E_SUCCESS, -1, r, "[%s] Failed to perform player_get_streaming_download_progress operation with - 0x%x", GetErrorMessage(r), err);
+
+ return returnValue;
+}
+
+
};
}; // Tizen::Media
result OpenUrlAsync(Player* pPlayerInstance, const Tizen::Base::String& url, const Tizen::Base::String& filePath, IPlayerProgressiveDownloadListener& listener, const Tizen::Base::Collection::IMap* pHeader = null);
void SetProgressiveDownloadIntervalByPercent(int percent);
result Construct(IPlayerEventListener& listener, Tizen::Graphics::Opengl::VideoTexture& videoTexture);
+ int GetHttpStreamingDownloadProgress(void) const;
void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);