2015-05-20 61 views
0

使用wysihtml5 https://github.com/xing/wysihtml5,我一直在試圖添加一個自定義的方式來添加視頻。我試圖執行https://github.com/arvigeus/bootstrap3-wysihtml5/blob/master/src/bootstrap3-wysihtml5.js,但是當我目前遇到2個問題時。 1)拒絕在一幀中顯示'https://www.youtube.com/watch?v=OOHYCZLmbyc',因爲它將'X-Frame-Options'設置爲'SAMEORIGIN'。問題與Wysihtml5和Iframe的視頻

2)當我提交表單時,零件被忽略。

當我嵌入的iframe中textarea的輸出是:

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

在我的日誌輸出,當我提交表單是:

「文本」=>」

其中」文本「是我的分區中的列名稱

回答

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

到: 「/表」 解決了這個問題

我補充說,該網址從更改腳本之前

1)Addind 「/ V」:我想出了一個修復

https://www.youtube.com/v/watch?v=OOHYCZLmbyc 
在我的上下文

我添加了這個:

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

2)我發現了計算器的解決方案建議,以便它忽略瞭解析器來修改wyshtml5腳本行:

見這裏的解決方案:https://stackoverflow.com/a/17175438/834161