Bug 1134434 - Fire loadedmetadata before encrypted event on encrypted MP4s - r=cpearce
This commit is contained in:
@@ -3066,7 +3066,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);
|
||||
@@ -3086,6 +3086,14 @@ void HTMLMediaElement::MetadataLoaded(const MediaInfo* aInfo,
|
||||
ProcessMediaFragmentURI();
|
||||
mDecoder->SetFragmentEndTime(mFragmentEnd);
|
||||
}
|
||||
if (mIsEncrypted) {
|
||||
if (!mMediaSource) {
|
||||
DecodeError();
|
||||
return;
|
||||
}
|
||||
|
||||
DispatchEncrypted(aInfo->mCrypto.mInitData, aInfo->mCrypto.mType);
|
||||
}
|
||||
|
||||
// Expose the tracks to JS directly.
|
||||
for (OutputMediaStream& out : mOutputStreams) {
|
||||
|
||||
Reference in New Issue
Block a user