FIX: Don't cloak videos once they begin playing

This commit is contained in:
Robin Ward
2016-02-29 13:56:38 -05:00
parent 01e1bb53f1
commit d538bcbe40
4 changed files with 40 additions and 4 deletions

View File

@ -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;