Fire loadedmetadata before encrypted event

This commit is contained in:
trav90
2016-09-18 19:21:40 -05:00
committed by roytam1
parent b944f99a23
commit 3ef89dda87
10 changed files with 174 additions and 70 deletions
+7 -1
View File
@@ -3142,7 +3142,7 @@ void HTMLMediaElement::MetadataLoaded(const MediaInfo* aInfo,
nsAutoPtr<const MetadataTags> aTags)
{
mMediaInfo = *aInfo;
mIsEncrypted = aInfo->mIsEncrypted;
mIsEncrypted = aInfo->IsEncrypted();
mTags = aTags.forget();
mLoadedDataFired = false;
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_METADATA);
@@ -3162,6 +3162,12 @@ void HTMLMediaElement::MetadataLoaded(const MediaInfo* aInfo,
ProcessMediaFragmentURI();
mDecoder->SetFragmentEndTime(mFragmentEnd);
}
if (mIsEncrypted) {
if (!mMediaSource) {
DecodeError();
return;
}
}
// Expose the tracks to JS directly.
for (OutputMediaStream& out : mOutputStreams) {