This commit is contained in:
Chris Pearce 2010-10-17 10:04:16 +13:00
Родитель 5f29227858 ef77e5e7aa
Коммит c270aa11c4
2 изменённых файлов: 3 добавлений и 28 удалений

Просмотреть файл

@ -831,11 +831,9 @@ static PRBool IsAutoplayEnabled()
void nsHTMLMediaElement::UpdatePreloadAction()
{
PreloadAction nextAction = PRELOAD_UNDEFINED;
// If autoplay is set, or we're playing, we should always preload data,
// as we'll need it to play.
if ((IsAutoplayEnabled() && HasAttr(kNameSpaceID_None, nsGkAtoms::autoplay)) ||
!mPaused)
{
// If autoplay is set, we should always preload data, as we'll need it
// to play.
if (IsAutoplayEnabled() && HasAttr(kNameSpaceID_None, nsGkAtoms::autoplay)) {
nextAction = nsHTMLMediaElement::PRELOAD_ENOUGH;
} else {
// Find the appropriate preload action by looking at the attribute.
@ -1396,9 +1394,7 @@ NS_IMETHODIMP nsHTMLMediaElement::Play()
mPaused = PR_FALSE;
mAutoplaying = PR_FALSE;
// We changed mPaused and mAutoplaying which can affect AddRemoveSelfReference
// and our preload status.
AddRemoveSelfReference();
UpdatePreloadAction();
return NS_OK;
}

Просмотреть файл

@ -535,27 +535,6 @@ var tests = [
v.src = test.name;
},
},
{
// 18. On a preload='none' video, call play() before load algorithms's sync
// has run, the play() call should override preload='none'.
ended:
function(e) {
ok(true, "(18) Got playback ended.");
var v = e.target;
v._finished = true;
maybeFinish(v, 18);
},
setup:
function(v) {
v.addEventListener("ended", this.ended, false);
v._finished = false;
v.preload = "none";
v.src = test.name; // Schedules async section to continue load algorithm.
document.body.appendChild(v);
v.play(); // Should cause preload:none to be overridden.
},
}
];
function startTest(test, token) {