Prevent media from autoplaying when rendered as a feed story
Summary: Fixes T11845. Users can still embed a text panel on the home page to give it some ambiance. Test Plan: Wrote an autoplay video as a comment, saw it in feed. Before change: autoplay. After change: no auto play. On task: still autoplay. Reviewers: chad Reviewed By: chad Maniphest Tasks: T11845 Differential Revision: https://secure.phabricator.com/D16920
This commit is contained in:
@@ -462,7 +462,7 @@ abstract class PhabricatorFeedStory
|
||||
}
|
||||
|
||||
public function newMarkupEngine($field) {
|
||||
return PhabricatorMarkupEngine::getEngine();
|
||||
return PhabricatorMarkupEngine::getEngine('feed');
|
||||
}
|
||||
|
||||
public function getMarkupText($field) {
|
||||
|
||||
@@ -252,6 +252,12 @@ final class PhabricatorEmbedFileRemarkupRule
|
||||
$autoplay = null;
|
||||
}
|
||||
|
||||
// Rendering contexts like feed can disable autoplay.
|
||||
$engine = $this->getEngine();
|
||||
if ($engine->getConfig('autoplay.disable')) {
|
||||
$autoplay = null;
|
||||
}
|
||||
|
||||
return $this->newTag(
|
||||
$tag,
|
||||
array(
|
||||
|
||||
Reference in New Issue
Block a user