我正在使用ErrorDocument 404 default
ErrorDocument 403 default
DirectorySlash On
DirectoryIndex index.php index.html index.htm
Options +FollowSymLinks -Multiviews -Indexes
RewriteEngine on
RewriteBase /
RewriteCond %{DOCUMENT_ROOT}/$1 !-f
RewriteCond %{DOCUMENT_ROOT}/$1/ !-d
RewriteRule ^([\w-]+)/?$ index.php?page=$1 [L,QSA]
来自这样的网址视频:
AVPlayer
每件事情都很好我的视频加载也是如此,但在某些情况下我的视频会永久停顿(挂在框架中并且不会继续)!
问题
如果出现问题,我只会在流的开头收到-(void)initVideo
{
AVPlayerItem* playerItem = [AVPlayerItem playerItemWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@VideoFileURl",Video_BASE_URL]]];
avPlayer = [AVPlayer playerWithPlayerItem:playerItem];
AVPlayerLayer * avPlayerLayer = [AVPlayerLayer playerLayerWithPlayer:avPlayer];
avPlayerLayer.frame = self.imageUserImage.frame;
avPlayerLayer.videoGravity = AVLayerVideoGravityResize;
[self.imageUserImage.layer addSublayer:avPlayerLayer];
[self.avPlayer.currentItem addObserver:self forKeyPath:@"status" options:0 context:nil];
[avPlayer play];
}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object
change:(NSDictionary *)change context:(void *)context {
if (object == self.avPlayer && [keyPath isEqualToString:@"status"]) {
if (self.avPlayer.currentItem.status == AVPlayerStatusFailed) {
NSLog(@"AVPlayer Failed");
} else if (self.avPlayer.status == AVPlayerStatusReadyToPlay) {
NSLog(@"AVPlayerStatusReadyToPlay");
} else if (self.avPlayer.currentItem.status == AVPlayerItemStatusUnknown) {
NSLog(@"AVPlayer Unknown");
}
}
}
通知,但我需要在流式传输时收到通知,或者在流式传输时断开连接。
请帮助我如何处理流媒体中的网络错误(连接中断和更改网络状态 - >像AVPlayerStatusFailed
更新
我找到了解决方案,我应该使用reachability
但我不知道为什么我给这个连续