Skip to content

Commit

Permalink
feat(iOS): add maxAccurateDelta api
Browse files Browse the repository at this point in the history
  • Loading branch information
skufly authored and pingkai committed Mar 20, 2020
1 parent 71f6d80 commit 1bdfe3a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions platform/Apple/source/CicadaPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,16 @@ OBJC_EXPORT
*/
-(void)seekToTime:(int64_t)time seekMode:(CicadaSeekMode)seekMode;

/**
* 设置精准seek的最大间隔。
* @param delta 间隔时间,单位毫秒
*/
/****
* set the maximum interval of precision seek.
* @param delta interval in milliseconds
*/
-(void)setMaxAccurateSeekDelta:(int)delta;

/**
@brief 截图 CicadaImage: mac平台返回NSImage,iOS平台返回UIImage
*/
Expand Down
8 changes: 8 additions & 0 deletions platform/Apple/source/CicadaPlayer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#import "MediaPlayer.h"
#import "CicadaPlayer.h"
#import "CicadaPlayerView.h"
#import "utils/af_string.h"
#import "utils/CicadaDynamicLoader.h"
#import "utils/frame_work_log.h"
#import "thumbnail/CicadaThumbnail.h"
Expand Down Expand Up @@ -460,6 +461,13 @@ -(void)seekToTime:(int64_t)time seekMode:(CicadaSeekMode)seekMode
}
}

-(void)setMaxAccurateSeekDelta:(int)delta
{
if (self.player) {
self.player->SetOption("maxAccurateSeekDelta", AfString::to_string(delta).c_str());
}
}

-(void) setDuration:(int64_t)value
{
if (self.player) {
Expand Down

0 comments on commit 1bdfe3a

Please sign in to comment.