百度智能云

All Product Document

          Multimedia Cloud Processing

          Quick Query of Interface

          In order to facilitate the user to query, we provide the interface list related to player and HLS download. P means attribute and F means method.

          Player

          BDCloudMediaPlayerAuth

          Be responsible for AccessKey authorization:

          S/N Name Type Parameter Return value Description
          1 sharedInstance F - Singleton instance Get singletons
          2 delegate P - - Set authentication agent, which is generally AppDelegate
          3 authenticateLicenseID:
          completionHandler
          F String LicenseID - Set the LicenseID to initiate the asynchronous authentication operation

          BDCloudMediaPlayerAuthDelegate

          AccessKey authentication callback event:

          S/N Name Type Parameter Return value Description
          1 authStart F - - Start authentication
          2 authEnd F NSError error - After the completion of authorization, the error with null indicates that the authorization succeeded

          BDCloudMediaPlayerBitrateItem

          One code rate item for abstract HLS video with multiple-code rate:

          S/N Name Type Parameter Return value Description
          1 resolution P - - Resolution, in pixel
          2 bitrate P - - Code rate, in bps

          BDCloudMediaPlayerMeidaItem

          Abstract a video item of the seamless switchover video, mainly used for video seamless switchover:

          S/N Name Type Parameter Return value Description
          1 itemFromString F NSString video information - Initialize the video information
          2 resolution P - - Resolution, in pixel
          3 bitrate P - - Code rate, in bps

          BDCloudMediaPlayerController

          Main interface

          S/N Name Type Parameter Return value Description
          1 view P - - Responsible for rendering the video frames, should be added to UI and set the layout information.
          2 contentURL P - - Video play address (NSURL form)
          3 contentString P - - Video playback address (NSString form)
          4 isPreparedToPlay P - - Whether is ready to play
          5 playbackState P - - Current play status of the player
          6 loadState P - - Current loading status of the player
          7 scalingMode P - - Image zoom mode
          8 initialPlaybackTime P - - Set and get the video starting play position, with the unit of second
          9 currentPlaybackTime P - - Set or get setting video play, with the unit of second
          10 naturalSize P - - Get the video resolution ratio
          11 videoDAR P - - Custom the length-width ratio of video
          12 duration P - - Set the total duration of the video, with the unit of second
          13 playableDuration P - - Get the current playable duration of the video, with the unit of second
          14 shouldAutoplay P - - Set or get whether to allow video auto play
          15 shouldAutostop P - - Set or get whether to allow auto-stop of the video
          16 playbackRate P - - Set or get the speed playback rate, range [0.0, 4.0]
          17 playbackVolume P - - Video play sound volume, with the range of [0.0, 1.0]
          18 downloadSpeed P - - Get online video download speed, in Bps.
          19 clearCanvasWhenReset P - - Set or get whether to clean the screen of the player by Reset, which is NO by default
          20 videoBitrate P - - The bit rate output by current video encoder is in kbps
          21 audioBitrate P - - The bit rate output by current audio encoder is in kbps
          22 initWithContentURL: F NSURL instance Introduce video play address (NSURL form) to initialize the player
          23 initWithContentString: F NSString instance Introduce the video play address (NSString form) to initialize the player
          24 prepareToPlay F - - Start asynchronous initialization video
          25 play F - - Play the video, SDK automatically called if isPreparedToPlay is YES
          26 pause F - - Pause play
          27 stop F - - Stop the playback, after which you need to initialize the video again
          28 reset F - - Reset the player, and you can set other video URL after resetting
          29 seek: F NSTimeInterval - Locate the playback position rapidly
          30 isPlaying F - BOOL Whether the video is being played
          31 setPauseInBackground: F BOOL - After App backstage switchover, whether to pause the play
          32 enableLooping: F BOOL - Loop playback or not
          33 enableAutoIdleTimerDisabled: F BOOL - Set the player screen long lightening by auto control
          34 setMaxCacheSizeInBytes: F NSUInteger - Set the size of the buffer zone, with the unit of byte
          35 setCachePauseTime: F NSTimeInterval - Set the minimum duration of the buffering zone. The unit is second
          36 setFirstBufferingTime: F NSTimeInterval - Set the maximum cache duration when starting play. The unit is second
          37 toggleFrameChasing: F BOOL - Whether to enable frame chase playback
          38 setTimeoutInUs: F int - Set up the time-out duration during the connection establishment and data download. The unit is microsecond
          39 thumbnailImageAtCurrentTime F - UIImage Screenshot
          40 proxy p - - Player network agent
          41 setMaxCacheDurationInSeconds: F NSTimeInterval - Set the buffering zone duration. The unit is second
          42 playType p Video play types - Set video play type. Default video-on-demand/VOD.
          43 userDefine p NSDictionary - Set the user-customized information
          44 tcpLoadSizeBlock p - - Set TCP data download callback
          45 startRecording:videoCompressionSettings:audioCompressionSettings:recordCallBack: F 1.NSString(file record address)2.NSDictionary (For video record configuration, please see the interface file)3.NSDictionary (For audio record configuration, please see the interface file)4.void(^)(int status) (record status callback function) - Start the video record file
          46 stopRecord: F void(^)(int status) (Record status callback function) - Stop the video record file.

          Hardware acceleration

          S/N Name Type Parameter Return value Description
          1 setVideoDecodeMode: F Decoding mode - Set decoding mode
          2 viaHardwareAccelerate F - BOOL Get whether the current video is using hardware acceleration

          Rapid switch of multiple code rates(HLS)

          S/N Name Type Parameter Return value Description
          1 getSupportedBitrates F - List of multi-code rate Get multi-code rate lists
          2 bitrateIndex F - Code rate index Get the current code rate index
          3 setBitrateIndex: F Code rate index - Set the current code rate index

          Multi-rate seamless switchover(Mainstream media formats such as HLS and MP4)

          S/N Name Type Parameter Return value Description
          1 setMediaItemsInputType: F Video input format - Set video input format
          2 setMediaItems: F Video address list - Set video address list
          3 getMediaItems: F - Video list information Get the video information of the video list
          4 mediaItemIndex F - Video index Get the currently played video index
          5 setMediaItemIndex: F Video index BOOL Switch the video

          Class method

          S/N Name Type Parameter Return value Description
          1 + setLogReport: F BOOL - Set whether to enable logs
          2 + setLogLevel: F Log level - Set log level.
          3 + setLogPath: F NSString - Set the log output path
          4 + logPath F - NSString Get log paths
          5 + clearDiskLog F - - Clean the logs of the current path
          6 + getSDKVersion F - SDK version Get the SDK version

          DRM

          S/N Name Type Parameter Return value Description
          1 setPlayerID:key: F playerId
          playerKey
          - Set custom playerId and playerKey
          2 setToken: F token - Set temporary token for encrypted videos

          Watermark

          S/N Name Type Parameter Return value Description
          1 setWatermark: F UIImage - Set the photos with watermark
          2 setWatermarkPosition: F CGPoint location - Set the watermark position, and you may need to reset when the layout changes

          Option

          S/N Name Type Parameter Return value Description
          1 setOptionValue:forKey:ofCategory F NSString
          NSString
          BDCloudMediaPlayerOptionCategory
          - Set the player options, and the value is character string.
          2 setOptionIntValue:forKey:ofCategory F int64_t
          NSString
          BDCloudMediaPlayerOptionCategory
          - Set the player options, with the option value of integer value.

          HLS Download

          BDCloudMediaItem

          Abstract an offline HLS video.

          S/N Name Type Parameter Return value Description
          1 identify: P - - Read-only. Identification (SDK auto-generation)
          2 url: P - - Read-only. The origin URL of the video.
          3 title: P - - Read-only. Video title.
          4 path: P - - Read-only. Video data storage path.
          5 index: P - - Read-only. Playable file name The full path is path/index
          6 size: P - - Read-only. Data file size Value after completion of download.
          7 status: P - - Read-only. State Downloading/Ready/Miss。
          8 progress: P - - Read-only. Download progress.

          BDCloudMediaDownloadTask

          Abstract a download task.

          S/N Name Type Parameter Return value Description
          1 item: P - - Read-only. Offline HLS video-related information
          2 state: P - - Read-only. Task status. Wait/Running/Suspend/Canceled/Failure/Finish
          3 progress: P - - Read-only. Download speed of the task. The value is consistent with ‘item.progress `.

          BDCloudMediaDownload

          Download management

          S/N Name Type Parameter Return value Description
          1 delegate: P - - Set or get event agent
          2 initWithUser: F User - Introduce the username to initialize, and the event agent can be set through attribute
          3 initWithUser:delegate: F User
          event agent
          - Meanwhile, set the username and event proxy for initialization
          4 frozen: F Whether the BOOL freezes dispatch - Set whether to freeze scheduling
          5 mediaItems F - Offline HLS video information array Return all information concerning downloading and completed offline HLS videos
          6 removeMediaItem: F Offline HLS video information - Delete an offline HLS video
          7 downloadTaskWithURL:title:error: F Video URL
          Video title.
          error
          Download tasks Create a download task
          8 suspendTask: F Task: - Mounting task
          9 resumeTask: F Task: - Resumption task
          10 cancelTask: F Task: - Cancel the task (downloaded data are deleted)
          11 resumeUncompletedTasks F - Task list Query and return the list of latest unfinished tasks
          12 stopAllTasks F - - Stop all the tasks
          13 clean F - - Clean all the downloaded data and directories. The instance is not available after calling.

          BDCloudMediaDownloadDelegate

          Download callback event

          S/N Name Type Parameter Return value Description
          1 taskStart: F Task: - Start the task
          2 task:needAuthentication: F Task:
          Authentication information storage dictionary
          - Set task authentication information
          You can set ‘playerId or ‘token field.
          3 task:progress: F Task:
          Progress
          - Task process report
          4 task:speed: F Task:
          Network speed
          - Task network speed report
          5 taskEnd:error: F Task:
          Error
          - Task is completed; it means the task is successfully downloaded when error is empty

          Thumbnail Display

          BDCloudSpriteRenderConfiguration

          Thumbnail rendering configuration

          S/N Name Type Parameter Return value Description
          1 row P - - Required. Number of rows of thumbnails in each Sprite
          2 column P - - Required. Array number of the thumbnails in every CSS sprite
          3 startTime P - - Optional. Start time, the default is 0
          4 thumbnailDuration P - - Required. Time interval between each thumbnail
          5 imageSize P - - Optional. CSS sprites resolution ratio, CGSizeZero by default
          6 margin P - - Optional. The edge distance of Sprite image defaults to 0
          7 padding P - - Optional. Thumbnail separation distance, which is 0 by default
          8 scalingMode P - - Optional. Rendering mode, BDCloudSpriteScalingModeNone by default
          9 defaultConfiguration F - Instance Initialize the method and set the default parameter

          BDCloudSpriteDownloadConfiguration

          Thumbnail download configurations

          S/N Name Type Parameter Return value Description
          1 imageList P - - Required. Multiple CSS sprites addresses, orderly.
          2 maxThreadNum P - - Optional. The maximum download thread count, which is 1 by default
          3 path P - - Optional. Disk storage path, which is the temporary folder by default, overlay
          4 defaultConfiguration F - Instance Initialization method

          BDCloudSpriteManager

          Thumbnail display management class

          S/N Name Type Parameter Return value Description
          1 renderView P - - Display thumbnail canvas
          2 status P - - Download status
          3 initWithRenderConfig:downloadConfig F Rendering configurations
          Download configuration
          Instance Initialization method
          6 startDownload: F BOOL
          NSError
          - Start downloading and call back
          9 stopDownload F - - End download
          10 clearCache F - - Clean the disk
          11 renderTime: F NSTimeInterval - Display the thumbnail of a certain moment

          Online Video Agent

          BDCloudMediaPlayerProtocol

          Player network agent

          S/N Name Type Parameter Return value Description
          1 onEnableIODelegate:url F Player example
          URL
          0: Support
          -1: Nonsupport
          Allow network proxy
          2 onOpenPlayer:url: F Player example
          URL
          0: Success
          -1: Failed
          Enable the video
          3 onReadplayer:url:buffer:size: F Player example
          URL
          Video data
          data size
          int: Actual data size read this time Video data reading
          4 onSeekplayer:url:offset:whence: F Player example
          URL
          Decentering amount
          Decentering type
          0: Success
          -1: Failed
          Video locating
          5 onCloseplayer:url: F Player example
          URL
          0: Success
          -1: Failed
          Disable the video
          6 onTotalSizePlayer:url: F Player example
          URL
          int_64: Total size of the video Get total size of the video

          Network Video Acceleration

          BDCloudMediaSourceManager

          Player online video acceleration

          S/N Name Type Parameter Return value Description
          1 countLimit p - - Pre-download channel number. Default 50.
          2 sizeLimit p - - The maximum storage space. 500M by default, with the unit of byte.
          3 configuration p - - Download configuration. Default.
          4 readTimeout p - - The network data download timeout duration during the process of play. Default 500ms.
          5 autoWriteCache p - - Enable the feature of saving while playing. Default Yes.
          6 enableWhenPreDwonloadFail p - - Whether to continuously keep the network library after failing to re-download. Default No.
          7 setVideoDuration:duration: F Video network connection
          Video duration
          - Set the total duration of the current video, and the starting play speed can be accelerated after setting.
          8 setVideoCacheTime:time F Video network connection
          Buffering duration
          - Data buffer time. 10S by default
          9 download:size:complete F Video network connection
          Pre-download size
          Successful callback
          - Pre-download a piece of video can improve the speed of starting play.
          10 downloadCancel: F Video network connection - Cancel to pre-download.
          11 downloadInCache: F Video network connection - Get to know whether the video is pre-downloaded successfully or not according to URL
          12 downloadCacheDelete: F Video network connection - Delete the downloaded resource in the disk.
          13 downloadCacheDeleteAll: F - - Delete all the download resources in the disk.

          VR Video Play

          BDCloudVRConfiguration

          VR video play configuration information

          S/N Name Type Parameter Return value Description
          1 defaultConfig F - BDCloudVRConfiguration instance Configuration information instance by default
          2 setProviderAVPlayerItem: F AVPlayerItem - Configure the VR rendering image input source as AVPlayerItem.
          3 setProviderImage F - - Configure the VR image input source as the UIimage image.
          4 setProviderBDCloudMediaPlayerView:
          viaHardwareAccelerate:
          F UIView:Baidu AI Cloud player rendering view
          BOOL:whether the hardware is decoded
          - Configure VR image input source as the Baidu Cloud Player rendering views.
          5 setInteractiveMode: F Interactive mode - Configure VR rendering interactive mode.
          6 setDisplayMode: F Rendering mode - Configure VR rendering mode.
          7 setProjectionMode: F The type of source - Configure VR rendering resource type.
          8 setPinchEnabled: F BOOL - Configure whether to allow pinch gestures.
          9 setRenderOn: F UIView - Configure parent view of the VR rendering views.

          BDCloudVRRenderControl

          VR video play control

          S/N Name Type Parameter Return value Description
          1 renderWithConfig: F VR rendering configuration instance BDCloudVRConfiguration instance VR rendering control instance
          2 switchImage: F UIImage - VR rendering control instance
          3 switchInteractiveMode: F Interactive mode - Switch the interactive method
          4 getInteractiveMode F - Interactive mode Get the current interactive method
          5 switchDisplayMode: F Rendering mode - Switch the rending mode
          6 getDisplayMode F - Rendering mode Access the current rendering mode
          7 switchProjectionMode: F The type of source - Switch the resource type
          8 getProjectionMode F - The type of source Get the current resource type
          9 pause F - - Pause VR rendering。
          10 resume F - - Start VR rendering。

          Self-adaption of Variable Bit Rate (VBR)

          BDCloudMediaAdaptiveItem

          Multi-rate video information

          S/N Name Type Parameter Return value Description
          1 init:bitrate F Video address
          Video code rate
          BDCloudMediaAdaptiveItem Multi-rate video information instance
          2 contentString P - - Video address
          3 bitrate P - - Video code rate
          4 mediaIndex P - - Player index

          BDCloudMediaAdaptiveControl

          Dynamic code rate self-adaptive switchover

          S/N Name Type Parameter Return value Description
          1 defaultControl F - BDCloudMediaAdaptiveControl Self-adaptive instance switching
          1 setItems: F NSArray - Set multi-rate video information
          1 setMaxCacheDuration: F NSTimeInterval - Set the maximum buffering duration
          1 setMaxCacheDuration: F NSTimeInterval - Set the maximum buffering duration
          1 setCacheDuration: F NSTimeInterval - Set the current cache duration
          1 setCurrentPlayIndex: F NSInterger - Set the current play index
          1 addLoadSize:loadSpeed F Size of downloaded data
          Download speed
          - Update the current download speed
          1 getPredictBandwidth F - int64_t Get a predictive broadband
          1 setMinLoadSizeInAddLoadSpeed F int64_t - Set the minimum downloads for the predicated bandwidth
          1 setMinLoadDurationInPredictMediaItem F int64_t - Set the minimum cache duration of the predicted switchover
          Previous
          Version Update Record
          Next
          Service Level Agreement (SLA)