Closed olexus closed 6 years ago
Would be cool. What is the best alternative currently? Embed, or just link to video?
@jeffreywyman Embedding and linking are the two current options.
I add my voice to being able to simply insert a video. Would be interesting if you could provide an option to look "locally" on the server for media as well. Kind of similar to how you do it with images.
How exactly do you embed video using the tinymce media plugin ? It seems like BookStack comes with that plugin by default, but I'm still not able to embed video.
@Floppybobby I made it to turn on the default media plugin in TinyMCE by doing the following:
In public > js > common.js
Add the 'media' parameter to the plugins
and the toolbar
option
Then run: npm run-script build
if you ar not watching already
Output:
@dennis1502 solid working solution. Mucho gracias 👍
Modify: /resources/assets/js/pages/page-form.js (as described)
Then on root path:
npm install && npm run production
public/js/common.js receives new compressed output.
If you're not running with npm, or just feel like it, you can edit public/js/common.js directly and add 'media' to 'plugins' and 'toolbar' - works.
I'm running bookstack in docker. I edited public/js/common.js as described by @henkedk and @dennis1502 but I don't see any difference afterward. Do I need to restart bookstack somehow? (I did restart the docker container after editing but still didn't see any difference.)
Also, maybe I'm editing wrong. In common.js I see:
plugins:c,imagetools_toolbar:"imageoptions",toolbar:"undo redo | styleselect |
and changed this to
plugins:media,c,imagetools_toolbar:"imageoptions",toolbar:"media undo redo | styleselect |
Did I do this right? I'm not sure of the syntax since it's all minified.
Thanks!
in latest version plugins
property was moved up in scope to a variable, you'll have to search for var c="
instead (may differ between minifications via gulp, your snippet labels it "c", as in: plugins:c,
), it'll be a long string value containing the plugins.
Toolbar you edited correctly though
Edit: My hope, is that maintainers will move it up to an admin-area editable field via database or config .env var. That way we can edit these from the admin area via GUI. I believe that may be in the works, since they moved the string to a js variable out of normal scoping. If not, well I'm sure one of us if not myself will make a PR for it.
@ssddanbrown - I'd like to take a crack at this. Do you think for now adding just the media plugin to TinyMCE is OK, or would you want a full fledged media library like we have for images? Maybe update the current image library to handle both?
@Abijeet Okay, Thanks. Just the media plugin should be fine. I think a full-fledged media library may not be worth it for videos as most shared videos won't be in standard file format but a range of embedd-able iframes. A lot more variance compare to images.
For Feature Requests
It would be great to add the ability to insert video in pages. I did this using tinymce media plugin, but little uncomfortably.