视频的 Wysihtml5 和 Iframe 问题

Issue with Wysihtml5 and Iframe for videos

https://github.com/xing/wysihtml5, I've been trying to add a custom way to add videos. I tried the implementation of https://github.com/arvigeus/bootstrap3-wysihtml5/blob/master/src/bootstrap3-wysihtml5.js 使用 wysihtml5 但当我目前 运行 遇到 2 个问题时。

1) 拒绝在框架中显示“https://www.youtube.com/watch?v=OOHYCZLmbyc”,因为它将 'X-Frame-Options' 设置为 'SAMEORIGIN'。

2) 当我提交表单时,该部分被忽略了。

当我在 textarea 中嵌入 iframe 时的输出是:

<div class="embed-responsive embed-responsive-16by9">
  <iframe class="embed-responsive-item" src="https://www.youtube.com/watch?v=LzWmhO4zw7M" allowfullscreen="">
    #document
      <html>
         <head>
         </head>
      </html>
  </iframe>
</div>

我提交表单时日志中的输出是:

"text"=>"
"

其中 "text" 是我的数据库中的列名

我找到了解决办法:

1) 在"/watch"之前添加"/v"解决了这个问题

我添加了一个脚本来更改 url 来自:

https://www.youtube.com/watch?v=OOHYCZLmbyc

https://www.youtube.com/v/watch?v=OOHYCZLmbyc

在我的上下文中,我添加了这个:

video.src = src["src"].replace("://www.youtube.com/watch", "://www.youtube.com/v/watch")

2) 我在 Whosebug 上找到了一个解决方案,建议修改 wyshtml5 脚本中的一行,使其忽略解析器:

在此处查看解决方案: