2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FMediaPlayer.h
20 * @brief This is the header file for the %Player class.
22 * This header file contains the declarations of the %Player class.
25 #ifndef _FMEDIA_PLAYER_H_
26 #define _FMEDIA_PLAYER_H_
28 #include <FBaseObject.h>
29 #include <FBaseString.h>
30 #include <FBaseUtilUri.h>
31 #include <FBaseByteBuffer.h>
32 #include <FBaseObject.h>
33 #include <FBaseColIMap.h>
34 #include <FGrpBufferInfo.h>
35 #include <FGrpVideoTexture.h>
36 #include <FMediaPlayerTypes.h>
37 #include <FMediaAudioTypes.h>
38 #include <FMediaMediaStreamInfo.h>
39 #include <FMediaAudioManagerTypes.h>
40 #include <FMediaIPlayerEventListener.h>
41 #include <FMediaIPlayerVideoEventListener.h>
42 #include <FMediaIPlayerProgressiveDownloadListener.h>
44 namespace Tizen { namespace Media
49 * @brief This class provides methods to play audio and video.
53 * The %Player class provides methods to play audio and video, including:
54 * - Playing the audio or video content stored in the local storage (internal and external memory).
55 * - Playing the audio or video content stream from the content server over RTSP or HTTP.
56 * - Operating general controls for the audio or video content, such as play, pause, resume, and stop.
57 * - Moving the audio or video content on the basis of time.
58 * - Controlling the volume of the audio or video content.
59 * - Looping the audio or video content.
60 * - Getting the duration of an audio or the video content.
61 * - Playing back multiple audio streams.
63 * The maximum count of the %Player instance is limited by Media::MediaCapability class.
65 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/media/playing_audio.htm">Playing Audio</a> and <a href="../org.tizen.native.appprogramming/html/guide/media/playing_video.htm">Playing Video</a>.
67 * The following example demonstrates how to use the %Player class to play an audio or video file.
71 * #include <FGraphics.h>
76 * using namespace Tizen::Base;
77 * using namespace Tizen::Graphics;
78 * using namespace Tizen::Ui;
79 * using namespace Tizen::Ui::Controls;
80 * using namespace Tizen::Media;
83 * : public Tizen::Ui::Controls::Form
84 * , public Tizen::Media::IPlayerEventListener
85 * , public Tizen::Media::IPlayerVideoEventListener
88 * result StartVideo(void);
89 * result StartAudio(void);
90 * result StartVideoWithVideoEventListener(void);
94 * // IPlayerEventListener
95 * virtual void OnPlayerOpened(result r) {}
96 * virtual void OnPlayerEndOfClip(void) {}
97 * virtual void OnPlayerBuffering(int percent) {}
98 * virtual void OnPlayerErrorOccurred(PlayerErrorReason r) {}
99 * virtual void OnPlayerInterrupted(void) {}
100 * virtual void OnPlayerReleased(void) {}
101 * virtual void OnPlayerSeekCompleted(result r) {}
102 * virtual void OnPlayerAudioFocusChanged (void) {}
104 * // IPlayerVideoEventListener
105 * virtual void OnVideoFrameDecoded(Player &src, BitmapPixelFormat bitmapPixelFormat, const Dimension &dim,
106 * const byte *pBuffer, int sizeOfBuffer, result r);
110 * OverlayRegion *__pOverlay;
113 * PlayerSample::PlayerSample(void)
119 * PlayerSample::StartVideo(void)
121 * result r = E_SUCCESS;
122 * Rectangle rect(0, 0, 320, 240);
123 * BufferInfo bufferInfo;
124 * String filePath = Tizen::App::App::GetInstance()->GetAppRootPath() + L"data/test.mp4";
126 * // Gets OverlayRegion from this Form
127 * __pOverlay = GetOverlayRegionN(rect, OVERLAY_REGION_TYPE_NORMAL);
128 * if (__pOverlay == null)
130 * return GetLastResult();
133 * __pOverlay->GetBackgroundBufferInfo(bufferInfo);
135 * r = __player.Construct(*this, &bufferInfo);
141 * // Opens file synchronously
142 * r = __player.OpenFile(filePath, false);
148 * __player.SetLooping(true);
149 * __player.SetVolume(80);
151 * r = __player.Play();
166 * PlayerSample::StartAudio(void)
168 * result r = E_SUCCESS;
169 * String filePath = Tizen::App::App::GetInstance()->GetAppRootPath() + L"data/test.mp3";
171 * r = __player.Construct(*this);
177 * // Opens file synchronously
178 * r = __player.OpenFile(filePath, false);
184 * __player.SetVolume(80);
186 * r = __player.Play();
196 * PlayerSample::Stop(void)
209 * PlayerSample::StartVideoWithVideoEventListener(void)
211 * result r = E_SUCCESS;
212 * Rectangle rect(0, 0, 320, 240);
213 * String filePath = Tizen::App::App::GetInstance()->GetAppRootPath() + L"data/test.mp4";
215 * r = __player.Construct(*this, *this);
221 * r = __player.OpenFile(filePath);
227 * // Gets OverlayRegion from this Form
228 * __pOverlay = GetOverlayRegionN(rect, OVERLAY_REGION_TYPE_NORMAL);
229 * if (__pOverlay == null)
231 * return GetLastResult();
234 * r = __player.Play();
252 * PlayerSample::OnVideoFrameDecoded(Player &src, BitmapPixelFormat bitmapPixelFormat, const Dimension &dim,
253 * const byte *pBuffer, int sizeOfBuffer, result r)
256 * OverlayRegionBufferPixelFormat overlayPixelFormat;
263 * if (__pOverlay == null)
268 * if (bitmapPixelFormat == BITMAP_PIXEL_FORMAT_ARGB8888)
270 * overlayPixelFormat = OVERLAY_REGION_BUFFER_PIXEL_FORMAT_ARGB8888;
272 * else if (bitmapPixelFormat == BITMAP_PIXEL_FORMAT_RGB565)
274 * overlayPixelFormat = OVERLAY_REGION_BUFFER_PIXEL_FORMAT_RGB565;
276 * else // Unsupported pixel format
281 * buf.Construct(pBuffer, 0, sizeOfBuffer, sizeOfBuffer);
282 * __pOverlay->SetInputBuffer(buf, dim, overlayPixelFormat);
289 class _OSP_EXPORT_ Player
290 : public Tizen::Base::Object
294 * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor.
298 * @remarks After creating an instance of this class, the Construct() method must be called explicitly to
299 * initialize this instance.
304 * This destructor overrides Tizen::Base::Object::~Object(). @n
305 * This method deallocates the resources. This method must be called in the same thread as the Construct()
312 virtual ~Player(void);
316 * Initializes this instance of %Player with the specified parameters.
320 * @return An error code
321 * @param[in] listener An instance of IPlayerEventListener
322 * @param[in] pBufferInfo The buffer information to display the video @n
323 * This information is essential to play a video but not required for an audio content.
324 * @exception E_SUCCESS The method is successful.
325 * @exception E_SYSTEM A system error has occurred.
326 * @exception E_OUT_OF_MEMORY The memory is insufficient.
327 * @exception E_RESOURCE_UNAVAILABLE The player's resources are unavailable.
328 * @remarks Multiple instances of %Player can be constructed.
330 result Construct(IPlayerEventListener& listener, const Tizen::Graphics::BufferInfo* pBufferInfo = null);
333 * Opens an audio or video file to be played. @n
334 * The %OpenFile() method works synchronously, but when the second parameter, @c isAsync is set to @c true, this method works asynchronously.
335 * Note that a method that works asynchronously must implement a listener.
338 * @brief <i> [Compatibility] </i>
342 * @compatibility This method has compatibility issues with %Tizen API versions@n
343 * For more information, see @ref CompIoPathPage "here".
346 * @return An error code
347 * @param[in] mediaLocalPath The local file path of the media source
348 * @param[in] isAsync Set to @c true for the asynchronous mode, @n
349 * else @c false for the synchronous mode
350 * @exception E_SUCCESS The method is successful.
351 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
352 * @exception E_SYSTEM A system error has occurred.
353 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
354 * @exception E_INVALID_DATA The specified file contains invalid data.
355 * @exception E_OUT_OF_MEMORY The memory is insufficient.
356 * @exception E_UNSUPPORTED_FORMAT The given content format is not supported.
357 * @exception E_RIGHT_EXPIRED The content right has expired.
358 * @exception E_RIGHT_NO_LICENSE The content has no license.
359 * @exception E_RIGHT_FUTURE_USE The content right is for future use.
360 * @exception E_DISPLAY_RIGHT_VIOLATED The display right is not valid for the specific output device. @b Since: @b 2.1
363 result OpenFile(const Tizen::Base::String& mediaLocalPath, bool isAsync = false);
366 * Opens an audio or video streaming content to play through the specified URL. @n
367 * The %OpenUrl() method works synchronously, but when the second parameter @c isAsync is set to @c true,
368 * this method works asynchronously. Note that a method that works asynchronously must implement a listener.
372 * @return An error code
373 * @param[in] mediaUri The URI of the media source
374 * @param[in] isAsync Set to @c true for the asynchronous mode, @n
375 * else @c false for the synchronous mode
376 * @exception E_SUCCESS The method is successful.
377 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
378 * @exception E_CONNECTION_FAILED The network connection has failed.
379 * @exception E_UNSUPPORTED_PROTOCOL The protocol is not supported.
380 * @exception E_SYSTEM A system error has occurred.
381 * @exception E_FILE_NOT_FOUND The remote file cannot be found or accessed.
382 * @exception E_UNSUPPORTED_FORMAT The given content format is not supported.
383 * @exception E_RIGHT_EXPIRED The content right has expired.
384 * @exception E_RIGHT_NO_LICENSE The content has no license.
385 * @exception E_RIGHT_FUTURE_USE The content right is for future use.
386 * @exception E_DISPLAY_RIGHT_VIOLATED The display right is not valid for the specific output device. @b Since: @b 2.1
387 * @remarks This method is not thread-safe when @c isAsync is @c false.
388 * @remarks Input URL should be encoded if there are non-alphanumeric characters in URL.
391 result OpenUrl(const Tizen::Base::Utility::Uri& mediaUri, bool isAsync = false);
394 * Opens an audio or video content to play on the memory. @n
395 * The %OpenBuffer() method works synchronously, but when the second parameter @c isAsync is set to @c true, this method works asynchronously.
396 * Note that a method that works asynchronously must implement a listener.
400 * @return An error code
401 * @param[in] mediaBuffer A pointer to the media source in the external memory
402 * @param[in] isAsync Set to @c true for asynchronous mode, @n
403 * else @c false for synchronous mode
404 * @exception E_SUCCESS The method is successful.
405 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
406 * @exception E_SYSTEM A system error has occurred.
407 * @exception E_OBJ_NOT_FOUND The specified media buffer cannot be found.
408 * @exception E_INVALID_DATA The specified buffer contains invalid data.
409 * @exception E_OUT_OF_MEMORY The memory is insufficient.
410 * @exception E_UNSUPPORTED_FORMAT The given content format is not supported.
411 * @exception E_RIGHT_EXPIRED The content right has expired.
412 * @exception E_RIGHT_NO_LICENSE The content has no license.
413 * @exception E_RIGHT_FUTURE_USE The content right is for future use.
414 * @exception E_DISPLAY_RIGHT_VIOLATED The display right is not valid for the specific output device. @b Since: @b 2.1
417 result OpenBuffer(const Tizen::Base::ByteBuffer& mediaBuffer, bool isAsync = false);
420 * Closes the audio or video content. @n
421 * The %Close() method works synchronously.
425 * @return An error code
426 * @exception E_SUCCESS The method is successful.
427 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
428 * @exception E_SYSTEM A system error has occurred.
436 * Plays the audio or video content. @n
437 * The playback starts from the current position. In case of the ::PLAYER_STATE_ENDOFCLIP player state, the audio or video content
442 * @return An error code
443 * @exception E_SUCCESS The method is successful.
444 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
445 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
446 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
447 * @exception E_UNSUPPORTED_CODEC The specified codec is not supported.
448 * @exception E_SYSTEM A system error has occurred. @n
449 * If playback has been paused, it resumes from the last position. @n
450 * E_SYSTEM is returned when unsupported format or codec media data are received during streaming. @n
451 * E_SYSTEM is returned when the unsupport resolution is set for rendering .
452 * @remarks When this method is called after the %Player instance is created with the Construct() method that accepts the IPlayVideoEventListener
453 * interface as a parameter, it delivers every video frame of a video content continuously until the state is changed to @c PLAYER_STATE_ENDOFCLIP,
454 * or the Stop() or Pause() method is called .
457 * @see IPlayerVideoEventListener
462 * Stops the playback of the audio or video content. @n
463 * The %Stop() method works synchronously.
467 * @return An error code
468 * @exception E_SUCCESS The method is successful.
469 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
470 * @exception E_SYSTEM A system error has occurred.
471 * @remarks In the Real Time Streaming Protocol (RTSP), this method stops the media stream and requests the termination of the network session.
478 * Pauses the playback of the audio or video content. @n
479 * To resume the playback, the Play() method must be called. The %Pause() method works synchronously.
483 * @return An error code
484 * @exception E_SUCCESS The method is successful.
485 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
486 * @exception E_SYSTEM A system error has occurred.
493 * Gets the state of an audio or video player.
497 * @return The current state of the player
504 PlayerState GetState(void) const;
507 * Gets the time for the current playback position of the audio or video content. @n
508 * Accuracy of the retrieved time is determined by the subsystem (for example, the time slice of the OS scheduler,
509 * time resolution of the audio or video codec, or implementation of the audio or video player).
510 * Note that it must not be assumed that the %GetPosition() method can reach the exact position mentioned by GetDuration().
514 * @return The current position of the player in milliseconds
515 * @exception E_SUCCESS The method is successful.
516 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
518 * - The specific error code can be accessed using the GetLastResult() method.
519 * - This method returns -1 when the method failed.
522 long GetPosition(void) const;
525 * Seeks the current playback position of the audio or video content to the specified time. @n
526 * The %SeekTo() method works asynchronously. @n
527 * Note that a method that works asynchronously must implement a listener. @n
528 * This method only works for the @c PLAYER_STATE_PLAYING, @c PLAYER_STATE_PAUSED, and @c PLAYER_STATE_OPENED states of the player. @n
529 * This method changes the playback position as well as the time value. @n
530 * In video, it may not change position accurately.
534 * @return An error code
535 * @param[in] msTime The time in milliseconds to move to the current playback position @n
536 * @c 0 indicates the starting position.
537 * @exception E_SUCCESS The method is successful.
538 * @exception E_INVALID_STATE This instance is in an invalid state for this method. @n
539 * While playing live streaming, this operation returns E_INVALID_STATE. @n
540 * This method returns E_INVALID_STATE, if this method is called again before
541 * IPlayerEventListener::OnPlayerSeekCompleted() is called.
542 * @exception E_OUT_OF_RANGE The specified time is out of range.
543 * @exception E_INVALID_DATA The media data is inappropriate for seeking.
544 * @exception E_SYSTEM A system error has occurred.
545 * @remarks For video, this method delivers one video frame on the specified position through the video
546 * event. Before calling this method, the %Player instance must be created with the Construct()
547 * method has a parameter of the IPlayVideoEventListener interface .
549 * @see IPlayerVideoEventListener
551 result SeekTo(long msTime);
554 * Gets the total running time of the media source.
558 * @return The running time of the media source in milliseconds
559 * @exception E_SUCCESS The method is successful.
560 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
561 * @remarks The specific error code can be accessed using the GetLastResult() method. @n
562 * While playing live streaming, this operation returns @c 0.
564 * - 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.
565 * - This method returns -1 when the method failed.
568 long GetDuration(void) const;
571 * Sets the specified value for the volume of an audio or video player.
575 * @return An error code
576 * @param[in] volume The new value of volume @n
577 * The range of this parameter is @c 0 to @c 100 and it is proportional to the current media sound volume level in setting.
578 * @exception E_SUCCESS The method is successful.
579 * @exception E_OUT_OF_RANGE The specified @c volume is out of range.
580 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
585 result SetVolume(int volume);
588 * Gets the current volume of an audio or video player.
592 * @return The current volume level @n
593 * The range of this return value is @c 0 to @c 100.
598 int GetVolume(void) const;
601 * Sets the mute status of an audio or video player.
605 * @return An error code
606 * @param[in] mute Set to @c true to mute the audio or video player, @n
608 * @exception E_SUCCESS The method is successful.
609 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
614 result SetMute(bool mute);
617 * Checks the mute status of an audio or video player.
621 * @return @c true if the audio or video player is muted, @n
627 bool IsMuted(void) const;
630 * Sets an audio or video player to be in a loop. @n
631 * Sets the looping to @c true to continuously play the audio or video content.
635 * @return An error code
636 * @param[in] looping Set to @c true to play the audio or video content in a loop, @n
638 * @exception E_SUCCESS The method is successful.
639 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
640 * @remarks In streaming, this method throws @c E_INVALID_STATE for the cost of network.
643 result SetLooping(bool looping);
646 * Checks whether the audio or video player is in a loop.
650 * @return @c true if the audio or video player is in a loop, @n
654 bool IsLooping(void) const;
657 * Gets the current media stream information.
661 * @return A pointer to the MediaStreamInfo instance containing metadata for the current media stream
662 * @exception E_SUCCESS The method is successful.
663 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
664 * @exception E_INVALID_CONTENT The content is inappropriate to compose media stream information.
665 * @exception E_SYSTEM A system error has occurred.
666 * @remarks This method returns a stream information of the media, which is currently being opened.
667 * The specific error code can be accessed using the GetLastResult() method.
668 * 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.
670 MediaStreamInfo* GetCurrentMediaStreamInfoN(void) const;
673 * Sets the rendering buffer for the video playback.
677 * @return An error code
678 * @param[in] bufferInfo The buffer information to display the video
679 * @exception E_SUCCESS The method is successful.
680 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
681 * @exception E_INVALID_ARG The specified input parameter is invalid.
682 * @exception E_SYSTEM A system error has occurred. @n
683 * E_SYSTEM is returned when the unsupport resolution is set for rendering .
684 * @remarks This method works for the @c PLAYER_STATE_OPENED, @c PLAYER_STATE_ENDOFCLIP, @c PLAYER_STATE_STOPPED, @c PLAYER_STATE_PAUSED, and @c PLAYER_STATE_PLAYING states of the player.
685 * @remarks This method throws @c E_INVALID_STATE after the player instance is constructed with IPlayerVideoEventListener.
687 result SetRenderingBuffer(const Tizen::Graphics::BufferInfo& bufferInfo);
690 * Initializes this instance of %Player with the specified parameters.
694 * @return An error code
695 * @param[in] listener An IPlayerEventListener instance
696 * @param[in] videoListener An IPlayerVideoEventListener instance
697 * @exception E_SUCCESS The method is successful.
698 * @exception E_SYSTEM A system error has occurred.
699 * @exception E_RESOURCE_UNAVAILABLE The player's resources are unavailable.
700 * @exception E_OUT_OF_MEMORY The memory is insufficient.
701 * @remarks This method constructs the %Player instance to render the video content into the buffer of the video event listener.
703 result Construct(IPlayerEventListener& listener, IPlayerVideoEventListener& videoListener);
706 * Captures the video frame. @n
707 * The %CaptureVideo() method delivers one video frame of a video content by using the IPlayVideoEventListener interface only once in the %Player instance. @n
708 * This method works only for the @c PLAYER_STATE_OPENED state of the %Player instance, and the state of the %Player instance is changed to @c PLAYER_STATE_PAUSED from @c PLAYER_STATE_OPENED after calling this method.
712 * @return An error code
713 * @exception E_SUCCESS The method is successful.
714 * @exception E_INVALID_STATE This instance is in an invalid state for this method. @n
715 * This method throws E_INVALID_STATE if the %Player instance is
716 * constructed without IPlayerVideoEventListener.
717 * @exception E_INVALID_OPERATION This method is invalid for the current media content.
718 * @exception E_SYSTEM A system error has occurred.
719 * @remarks In the Real Time Streaming Protocol (RTSP), this method does not work properly.
721 result CaptureVideo(void);
724 * Sets the audio stream type.
728 * @return An error code
729 * @param[in] type An audio stream type
730 * @exception E_SUCCESS The method is successful.
731 * @exception E_INVALID_ARG The specified input parameter is invalid.
732 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
733 * @remarks This method works for the @c PLAYER_STATE_INITIALIZED or @c PLAYER_STATE_CLOSED states of the %Player instance.
734 * In other states of %Player instance, this method returns @c E_SUCCESS, but the audio stream type is not changed properly.
736 result SetAudioStreamType(AudioStreamType type);
739 * Opens an audio or video streaming content to play through the specified URL with the HTTP header. @n
740 * The %OpenUrlAsync() method works asynchronously, thus application can call further methods of %Player after IPlayerEventListener::OnPlayerOpened() is called.
744 * @return An error code
745 * @param[in] url The URL of the media source
746 * @param[in] pHeader The list of field and value pairs that will be added in HTTP request header. @n
747 The types of field and value are described in the Programming Guide. If @c null, then default values will be set.
749 * @exception E_SUCCESS The method is successful.
750 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
751 * @exception E_UNSUPPORTED_PROTOCOL The protocol is not supported.
752 * @exception E_INVALID_ARG A specified input parameter is invalid.
753 * @exception E_OUT_OF_MEMORY The memory is insufficient.
754 * @remarks See Programming Guide for the detail information of supported HTTP header fields.
757 result OpenUrlAsync(const Tizen::Base::String& url, const Tizen::Base::Collection::IMap* pHeader = null);
760 * Opens an audio or video streaming content to play through the specified HTTP URL with the HTTP header for the progressive download playback. @n
761 * The %OpenUrlAsync() method works asynchronously, thus application can call further methods of %Player after IPlayerEventListener::OnPlayerOpened() is called.
762 * The content information of the media source must be located at the beginning of the file for the progressive download playback. Otherwise, it does not guarantee to play and download media stream properly.
766 * @return An error code
767 * @param[in] url The URL of the media source
768 * @param[in] filePath The file path on local file system where the downloaded content will be saved
769 * @param[in] listener The download listener
770 * @param[in] pHeader The list of field and value pairs that will be added in HTTP request header @n
771 * The types of field and value are described in the Programming Guide.
772 * If @c null, then default values will be set.
773 * @exception E_SUCCESS The method is successful.
774 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
775 * @exception E_UNSUPPORTED_PROTOCOL The protocol is not supported.
776 * @exception E_INVALID_ARG A specified input parameter is invalid.
777 * @exception E_OUT_OF_MEMORY The memory is insufficient.
778 * @remarks The download will start when Play() is called.
779 * @remarks If the specified file name already exists, then the old file will be overwritten with the new one.
780 * @remarks See Programming Guide for the detail information of supported HTTP header fields.
783 result OpenUrlAsync(const Tizen::Base::String& url, const Tizen::Base::String& filePath, IPlayerProgressiveDownloadListener& listener, const Tizen::Base::Collection::IMap* pHeader = null);
787 * Sets the interval of calling the progress event.
791 * @param[in] percent The progress period interval as a percentage value
792 * @remark If the server does not provide the information about the content size, progress event will occur randomly.
793 * @remarks If the percentage value is not set, @c 10 will be set as a default value.
794 * @see IPlayerProgressiveDownloadListener::OnPlayerProgressiveDownloadInProgress()
796 void SetProgressiveDownloadIntervalByPercent(int percent);
799 * Initializes this instance of %Player with the specified parameters.
803 * @return An error code
804 * @param[in] listener An IPlayerEventListener instance
805 * @param[in] videoTexture An VideoTexture instance
806 * @exception E_SUCCESS The method is successful.
807 * @exception E_INVALID_ARG A specified input parameter is invalid.
808 * @exception E_RESOURCE_UNAVAILABLE The player's resources are unavailable.
809 * @remarks This method constructs the %Player instance to render the video content into the video texture area.
811 result Construct(IPlayerEventListener& listener, Tizen::Graphics::Opengl::VideoTexture& videoTexture);
814 * Gets the current downloading progress of HTTP streaming playback in percent.
818 * @return The current position in percent
819 * @exception E_SUCCESS The method is successful.
820 * @exception E_INVALID_OPERATION The method works for HTTP streaming playback only.
821 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
823 * - This method works only for the @c PLAYER_STATE_PLAYING or PLAYER_STATE_PAUSED states of the %Player instance.
824 * - This method is not supported in HTTP Live Streaming.
825 * - The specific error code can be accessed using GetLastResult() method.
826 * - This method returns -1 when the method failed.
828 int GetHttpStreamingDownloadProgress(void) const;
832 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
836 Player(const Player& rhs);
839 *The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
843 Player& operator =(const Player& rhs);
845 friend class _PlayerImpl;
846 class _PlayerImpl* __pPlayerImpl;