mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
FIX: Don't cloak videos once they begin playing
This commit is contained in:
@ -7,6 +7,7 @@ import { addToolbarCallback } from 'discourse/components/d-editor';
|
||||
import { addWidgetCleanCallback } from 'discourse/components/mount-widget';
|
||||
import { decorateWidget, changeSetting } from 'discourse/widgets/widget';
|
||||
import { onPageChange } from 'discourse/lib/page-tracker';
|
||||
import { preventCloak } from 'discourse/widgets/post-stream';
|
||||
|
||||
class PluginApi {
|
||||
constructor(version, container) {
|
||||
@ -253,6 +254,20 @@ class PluginApi {
|
||||
changeWidgetSetting(widgetName, settingName, newValue) {
|
||||
changeSetting(widgetName, settingName, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevents an element in the post stream from being cloaked.
|
||||
* This is useful if you are using a plugin such as youtube
|
||||
* and don't want the video removed once it has begun
|
||||
* playing.
|
||||
*
|
||||
* ```javascript
|
||||
* api.preventCloak(1234);
|
||||
* ```
|
||||
**/
|
||||
preventCloak(postId) {
|
||||
preventCloak(postId);
|
||||
}
|
||||
}
|
||||
|
||||
let _pluginv01;
|
||||
|
Reference in New Issue
Block a user