From 0fa0610e4e9ec8e09f14438799e2d7354837e522 Mon Sep 17 00:00:00 2001 From: caixiaomin Date: Fri, 10 Aug 2018 18:26:52 +0800 Subject: [PATCH] [WEEX-556][iOS] Fix video play state is not 'play' while set autoplay to true (#1418) --- .../WeexSDK/Sources/Component/WXVideoComponent.m | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Component/WXVideoComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXVideoComponent.m index cf3a5fc681..c6b955e0bf 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXVideoComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXVideoComponent.m @@ -333,14 +333,6 @@ -(void)viewDidLoad _videoView = (WXVideoView *)self.view; [_videoView setURL:_videoURL]; [_videoView setPosterURL:_posterURL]; - if (_playStatus) { - [_videoView play]; - } else { - [_videoView pause]; - } - if (_autoPlay) { - [_videoView play]; - } __weak __typeof__(self) weakSelf = self; _videoView.posterClickHandle = ^{ [weakSelf.videoView play]; @@ -367,6 +359,14 @@ -(void)viewDidLoad } [weakSelf fireEvent:eventType params:nil]; }; + if (_playStatus) { + [_videoView play]; + } else { + [_videoView pause]; + } + if (_autoPlay) { + [_videoView play]; + } } -(void)updateAttributes:(NSDictionary *)attributes