зеркало из https://github.com/mozilla/gecko-dev.git
Bug 992685 - Part 2. Fire resize event when video size changes. r=roc
This commit is contained in:
Родитель
c198c1283a
Коммит
c5d2a30b2c
|
@ -3002,6 +3002,10 @@ void HTMLMediaElement::MetadataLoaded(const MediaInfo* aInfo,
|
|||
mLoadedDataFired = false;
|
||||
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_METADATA);
|
||||
DispatchAsyncEvent(NS_LITERAL_STRING("durationchange"));
|
||||
if (IsVideo() && mHasVideo) {
|
||||
mMediaSize = aInfo->mVideo.mDisplay;
|
||||
DispatchAsyncEvent(NS_LITERAL_STRING("resize"));
|
||||
}
|
||||
DispatchAsyncEvent(NS_LITERAL_STRING("loadedmetadata"));
|
||||
if (mDecoder && mDecoder->IsTransportSeekable() && mDecoder->IsMediaSeekable()) {
|
||||
ProcessMediaFragmentURI();
|
||||
|
@ -3642,6 +3646,10 @@ void HTMLMediaElement::NotifyDecoderPrincipalChanged()
|
|||
|
||||
void HTMLMediaElement::UpdateMediaSize(nsIntSize size)
|
||||
{
|
||||
if (IsVideo() && mReadyState != HAVE_NOTHING && mMediaSize != size) {
|
||||
DispatchAsyncEvent(NS_LITERAL_STRING("resize"));
|
||||
}
|
||||
|
||||
mMediaSize = size;
|
||||
UpdateReadyStateForData(mLastNextFrameStatus);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче