Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14347764
D16920.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D16920.diff
View Options
diff --git a/src/applications/feed/story/PhabricatorFeedStory.php b/src/applications/feed/story/PhabricatorFeedStory.php
--- a/src/applications/feed/story/PhabricatorFeedStory.php
+++ b/src/applications/feed/story/PhabricatorFeedStory.php
@@ -462,7 +462,7 @@
}
public function newMarkupEngine($field) {
- return PhabricatorMarkupEngine::getEngine();
+ return PhabricatorMarkupEngine::getEngine('feed');
}
public function getMarkupText($field) {
diff --git a/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php b/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php
--- a/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php
+++ b/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php
@@ -252,6 +252,12 @@
$autoplay = null;
}
+ // Rendering contexts like feed can disable autoplay.
+ $engine = $this->getEngine();
+ if ($engine->getConfig('autoplay.disable')) {
+ $autoplay = null;
+ }
+
return $this->newTag(
$tag,
array(
diff --git a/src/infrastructure/markup/PhabricatorMarkupEngine.php b/src/infrastructure/markup/PhabricatorMarkupEngine.php
--- a/src/infrastructure/markup/PhabricatorMarkupEngine.php
+++ b/src/infrastructure/markup/PhabricatorMarkupEngine.php
@@ -414,6 +414,10 @@
case 'default':
$engine = self::newMarkupEngine(array());
break;
+ case 'feed':
+ $engine = self::newMarkupEngine(array());
+ $engine->setConfig('autoplay.disable', true);
+ break;
case 'nolinebreaks':
$engine = self::newMarkupEngine(array());
$engine->setConfig('preserve-linebreaks', false);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 3:08 AM (20 h, 28 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6907643
Default Alt Text
D16920.diff (1 KB)
Attached To
Mode
D16920: Prevent media from autoplaying when rendered as a feed story
Attached
Detach File
Event Timeline
Log In to Comment