-
Notifications
You must be signed in to change notification settings - Fork 0
/
EUVideoPageViewCell.m
57 lines (45 loc) · 1.29 KB
/
EUVideoPageViewCell.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// EUVideoPageViewCell.m
// EUPage
//
// Created by wangliqun on 15/6/1.
// Copyright (c) 2015年 wangliqun. All rights reserved.
//
#import "EUVideoPageViewCell.h"
#import "SlateWebImageView.h"
#import "EUBaseModel.h"
@implementation EUVideoPageViewCell
-(void)loadDataWithModel:(EUBaseModel *)model
{
[super loadDataWithModel:model];
if(!self.videoImageView)
{
_videoImageView = [[SlateWebImageView alloc] init];
_videoImageView.backgroundColor = [UIColor clearColor];
[self.contentView addSubview:_videoImageView];
}
self.videoImageView.frame = self.bounds;
self.videoImageView.imageView.frame = self.bounds;
[self.videoImageView setVideoWithURL:[NSURL URLWithString:model.resourceUrl] coverImageURL:nil];
[self.videoImageView play];
[self.videoImageView setMuted:NO];
}
- (void)prepareForReuse
{
[super prepareForReuse];
if (self.videoImageView)
{
[self.videoImageView stop];
[self.videoImageView setMuted:YES];
[self.videoImageView setVideoWithURL:nil coverImageURL:nil];
}
}
-(void)cellWillDisplayAtIndexPath:(NSIndexPath *)indexpath
{
}
-(void)cellDidEndDisPlayAtIndexPath:(NSIndexPath *)indexpath
{
[self.videoImageView setMuted:YES];
[self.videoImageView stop];
}
@end