Bug 1130948: Part1. Use mediasource duration to determine media element duration. r=cajbir

This commit is contained in:
Jean-Yves Avenard 2015-02-12 18:52:12 +11:00
parent 51f02c8f33
commit 1ea130aa5a
2 changed files with 10 additions and 0 deletions

View File

@ -309,4 +309,11 @@ MediaSourceDecoder::IsActiveReader(MediaDecoderReader* aReader)
return mReader->IsActiveReader(aReader);
}
double
MediaSourceDecoder::GetDuration()
{
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
return mMediaSourceDuration;
}
} // namespace mozilla

View File

@ -56,6 +56,9 @@ public:
void Ended();
bool IsExpectingMoreData() MOZ_OVERRIDE;
// Return the duration of the video in seconds.
virtual double GetDuration() MOZ_OVERRIDE;
void SetInitialDuration(int64_t aDuration);
void SetMediaSourceDuration(double aDuration, MSRangeRemovalAction aAction);
double GetMediaSourceDuration();