Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update SCPlayer.m
Correction for the bug in the player showing a black screen.
  • Loading branch information
JoseMendesGouveia committed Jan 11, 2016
commit 86864a075267ab50cfbf3e933a6a60082f0287d5
4 changes: 3 additions & 1 deletion Library/Sources/SCPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ - (id)init {
self = [super init];

if (self) {
_shouldSuppressPlayerRendering = YES;
_shouldSuppressPlayerRendering = NO;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you want this to be false by default?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To prevent black screen bug, when playing a movie preview.

[self addObserver:self forKeyPath:@"currentItem" options:NSKeyValueObservingOptionNew context:ItemChanged];
}

Expand Down Expand Up @@ -321,6 +321,8 @@ - (void)setItemByAsset:(AVAsset *)asset {
}

- (void)setItem:(AVPlayerItem *)item {
[self unsetupDisplayLink];
[self setupDisplayLink];

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What those these two lines fix?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same previous bug, to prevent black screen bug, when playing a movie preview.

[self replaceCurrentItemWithPlayerItem:item];
}

Expand Down