我的要求是使用hi-chart获取图表,如下所示。
我尝试了所有类型的柱形图。这是我发现的东西。
尝试使用偏移,但标签重叠,偏移需要根据数据和屏幕进行更改,这也是一个挑战。
代码:
- (void)playVideoWithUrl:(NSString *) videoUrl
{
if (player != nil) {
[player.currentItem removeObserver:self forKeyPath:@"status"];
[player.currentItem removeObserver:self forKeyPath:@"playbackLikelyToKeepUp"];
}
AVURLAsset * asset = [[AVURLAsset alloc]initWithURL:[NSURL URLWithString:videoUrl]
options:nil];
AVPlayerItem * item = [[AVPlayerItem alloc]initWithAsset:asset];
// Add KVO to detech status of loading video
[item addObserver:self
forKeyPath:@"status"
options:0
context:nil];
// Add KVO to detech when playback is loading buffer successfully
[item addObserver:self
forKeyPath:@"playbackLikelyToKeepUp"
options:0
context:nil];
// Detect when playback completed
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(playerItemDidReachEnd:)
name:AVPlayerItemDidPlayToEndTimeNotification
object:[player currentItem]];
[player replaceCurrentItemWithPlayerItem:item];
[player play];
}
我能解决这个问题的任何其他方式。