GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.38k stars 4.06k forks source link

How to add video block on blockManager #1514

Closed himanshubudhlakoti closed 6 years ago

himanshubudhlakoti commented 6 years ago

Hello All. i want to add a video block on blockmanager same as mentioned on below snapshot aaaa

i am using following code for adding video block on block manager


editor = grapesjs.init({
      autorender: 0,
      container: '#gjs',
      components: '<div class="txt-red"></div>',
      style: '.txt-red{color: red}',

blockManager: {
        appendTo: '#gjs',
        blocks: [
          {
            id: 'Video',
            label: 'Video',
            attributes: { class:'fa fa-video'},
            content: `
            <video controls>
            <source src="https://www.w3schools.com/tags/movie.mp4" type="video/mp4">
            <source src="https://www.w3schools.com/tags/movie.mp4" type="video/ogg">
            Your video
          </video>`,
            category: 'Basic',
          },
    ]

})```
 but that code does not works
please let me know how can i add video block on block manager 
yomeshgupta commented 6 years ago

@himanshubudhlakoti You can use https://github.com/artf/grapesjs-blocks-basic as a plugin. It has pre built blocks. Documentation is pretty straight forward on this.

himanshubudhlakoti commented 6 years ago

thnak you @yomeshgupta it has done

yomeshgupta commented 6 years ago

@himanshubudhlakoti You are welcome! Close this issue if it is resolved.

himanshubudhlakoti commented 6 years ago

ok

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.