BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
15.28k stars 1.9k forks source link

Feature Request: Add ability to insert video #266

Closed olexus closed 6 years ago

olexus commented 7 years ago

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.

jeffreywyman commented 7 years ago

Would be cool. What is the best alternative currently? Embed, or just link to video?

Shackelford-Arden commented 7 years ago

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

SRv6d commented 6 years ago

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.

denniseilander commented 6 years ago

@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: screen shot 2017-12-12 at 13 50 44

Source: https://www.tinymce.com/docs/plugins/media/

ensemblebd commented 6 years ago

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

henkedk commented 6 years ago

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.

fivestones commented 6 years ago

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!

ensemblebd commented 6 years ago

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.

Abijeet commented 6 years ago

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

ssddanbrown commented 6 years ago

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