-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Video is not rendered in view mode, but is ok in edit mode #1459
Comments
Same here. On the night mode. |
Videos are not yet supported in the rendering pipeline. |
Any idea as to when this will be implemented? |
I too have just discovered this bug. Embed video shows just fine in edit mode (whether using Markdown or WYSIWYG editors), but page render fails. Thanks for all the hard work on this app - embed vids would really help. |
Perhaps a good approach would be to hide the interface element for features that are not yet supported. |
It is possible to embed videos via iframes if HTML sanitation is turned off in |
Also came across this, hope the feature will be implemented soon! |
is it possible to embed iframes in the WYSIWYG or markdown editor? |
While I am able to use iframes thanks to @despens suggestion, the content fails to load when I am using assets that are uploaded into the editor's asset manager. I was able to display these through a hack before the latest update but now I cannot anymore. While most of my users can figure out an iframe (either through google, asking me, or looking at an example I did) they cannot upload assets elsewhere like I can. |
Is there any timeline for implementing support for videos in rendering pipeline? And will this include local video assets? I really like wiki.js but building up a user manual without videos is a bit frustrating. Hope this can be fixed soon. |
Ooh, just encountered this issue. Good there is a temporary workaround |
Videos still not showing, even with "Allow frames" on and "Sanitize HTML" off. |
Anything here? Pretty big deal. |
this embed share link code from youtube works for me: <iframe
width="560"
height="315"
src="https://www.youtube.com/embed/Mh5LY4Mz15o"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe> And changing the source to a local video also works: <iframe
width="560"
height="315"
src="/video/test.mp4"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe> note: it still works without the allow attribute and that content but i'm not sure if that help it with anything. maybe on mobile. and you can play with the hight and width, or use css for them. Like this: <iframe
width="560"
height="315"
src="/video/test.mp4"
frameborder="0"
allowfullscreen>
</iframe> My Settings: Security > Block IFrame Embedding: off the first one allows you assets to be loaded in an iframe. The third one allows you to have an iframe on your site. |
Would love to have this feature without needing any type of workaround, because I agree with @dude1756 that a "building up a user manual without videos is a bit frustrating". I tried @ccolella-mdc's settings and can get videos to show in Markdown, but I couldn't get WYSIWYG to work. What I did for responsively sized videos in Markdown:
So now we add:
on any page where we need a responsively sized YouTube video. |
Further - does anyone have a clear explanation of how to get an iframe to show on a WYSIWYG page? I must be confused - I don't see any way to edit source directly on a WYSIWYG page, so I'm not clear how to manually embed an iframe that would actually output an iframe. Is this only possible with the Markdown page type? |
@ryanmasuga It also works (surprise, surprise) on the HTML editor. I don't use the WYSIWYG editor because it has so many fewer features, and, as a software engineer myself, it feels too limiting. |
@ryanmasuga The WYSIWYG editor is not an HTML editor and it's not possible to edit / insert HTML code because CKEditor 5 simply doesn't have that feature. Use the Markdown editor if you need to edit / insert HTML code in your page. |
@ccolella-mdc I hadn't tried the HTML page type yet, but yes - the responsive embed code works there, too. @NGPixel Thanks. I know some WYSIWYG editors have a "Source" button that can expose the underlying HTML (useful for when something gets so bungled you have to manually fix it...), but I guess that's not the case here. We'll likely carry on with Markdown pages. |
Another solution is to use youtube's video images to display the video until this is fixed. i.e. http://img.youtube.com/vi/{video-id}/0.jpg Like so ...
Technically this is NOT embedding (link is opened in new tab) but for our case it works until it's fixed. Oh and this only works in Markdown. WYSIWYG editor doesn't have the functionality to link an external image :( |
+1 |
Is the fix for this issue planned in an upcoming release? |
@grandixximo thank you so much for your response. I disabled the block iframe under the security tab as instructed. Once again I attempted to share a youtube share link https://youtu.be/-mgenFHmCG4 by using the insert media function. However, I was foiled yet again. No positive results. I truly don't understand why this feature isn't enabled from the start. It is Paramount for any wiki. I really appreciate your help. Any other suggestions? |
I have videos working in my Wiki. I also tested the link you provided
and was able to put that into my Wiki, and it works fine.
None of this (below) is my original work, it is all from previous posts.
I hope this helps.
Lastly, I am running my Wiki on a hosted solution, and it is version 2.5.292
Regards, Bruno
//////////////////////////////////////////////////////////////////////////////////////
Other than the Theme Code Injection, I found that the only other setting
required was to "Allow iFrames" (*Modules > Rendering > HTML > Allow
iFrames*). Note this is NOT the same as "Block iFrame Embedding" (System
Security > Block iFrame Embedding), which, in my case, I have left
enabled. (I *think* this means other sites can not embed your site in an
iFrame on their site).
Here is the 'Allow iFrames':
For completeness, here are my code injections (*Site > Theme > Code
Injection > Head HTML Injection*):
<!-- ... support for Youtube and Vimeo embedded videos -->
<script type="text/javascript" defer>
const rxYoutube =
/^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/)|(?:(?:watch)?\?v(?:i)?=|\&v(?:i)?=))([^#\&\?]*).*/
const rxVimeo =
/^.*(vimeo\.com\/)((channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/
window.boot.register('vue', () => {
window.onload = () => {
document.querySelectorAll('.contents oembed, .contents
a').forEach(elm => {
const url = elm.hasAttribute('url') ? elm.getAttribute('url') :
elm.getAttribute('href')
let newElmHtml = null
const ytMatch = url.match(rxYoutube)
const vmMatch = !ytMatch && url.match(rxVimeo)
if (ytMatch) {
newElmHtml = `<iframe id="ytplayer" type="text/html"
width="640" height="360"
src="https://www.youtube.com/embed/${ytMatch[1]}" frameborder="0"
allowfullscreen></iframe>`
} else if (vmMatch) {
newElmHtml = `<iframe id="vmplayer" type="text/html"
width="640" height="360"
src="https://player.vimeo.com/video/${vmMatch[5]}" frameborder="0"
allowfullscreen></iframe>`
} else if (url.endsWith('.mp4')) {
newElmHtml = `<video controls autostart="0" name="media"
width="640" height="360"><source src="${url}" type="video/mp4"></video>`
} else {
return
}
const newElm = document.createElement('div')
newElm.classList.add('video-responsive')
newElm.insertAdjacentHTML('beforeend', newElmHtml)
elm.replaceWith(newElm)
})
}
})
</script>
…On 2023-01-19 2:09 AM, cyb3rathl3t3 wrote:
@grandixximo <https://github.com/grandixximo> thank you so much for
your response. I disabled the block iframe under the security tab as
instructed. Once again I attempted to share a youtube share link
https://youtu.be/-mgenFHmCG4 <https://youtu.be/-mgenFHmCG4> by using
the insert media function. However, I was foiled yet again. No
positive results. I truly don't understand why this feature isn't
enabled from the start. It is Paramount for any wiki.
I really appreciate your help. Any other suggestions?
—
Reply to this email directly, view it on GitHub
<#1459 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AU5OHF5YXCGZF3UTOD6NTGDWTEAEJANCNFSM4KSM3ZPA>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@BitWiseSE Thank you for all your help! I am running version 2.5.295. I tried your code as suggested copied and pasted into the Head HTML section in the settings Theme area. I also took a moment to double check Modules > Rendering > HTML > Allow-iFrames area. Which in my case it was disabled, so I did enable that option. Also reviewed block iframe and that was also enabled. In any case, I tried again and unfortunately it failed. I even tried the body section and that failed also. I don't know what could be causing this issue but its been since the start. I have been unable to add video since original install. Docker Container Ubuntu. Any other suggestions? I really appreciate the help from the board. Thank you |
I wonder if it might be a network issue, although I don't understand why
it would render in edit mode, but not in view mode.
Last idea, to maybe advance the trouble-shooting..
* Go to your Wiki, go to your page, in edit mode
* Open the debugger tools on your browser (press F12 on pretty well
any browser)
* Select the 'Network' tab
* Switch to view mode on your page ... any 'errors' showing up in the
'Network' area?
* Press on the youtube play (if it is there?) ... any 'errors' showing
up in the 'Network' area?
That probably won't help, but I've run out of ideas.
(btw, I did more testing and the 'Modules > Rendering > HTML > Security
Allow iFrames' is not necessary, in my case, your video (yes, in View
mode), works no matter how that is set)
.. Bruno
…On 2023-01-20 12:35 PM, cyb3rathl3t3 wrote:
@BitWiseSE <https://github.com/BitWiseSE> Thank you for all your help!
I am running version 2.5.295. I tried your code as suggested copied
and pasted into the Head HTML section in the settings Theme area. I
also took a moment to double check Modules > Rendering > HTML >
Allow-iFrames area. Which in my case it was disabled, so I did enable
that option. Also reviewed block iframe and that was also enabled. In
any case, I tried again and unfortunately it failed. I even tried the
body section and that failed also. I don't know what could be causing
this issue but its been since the start. I have been unable to add
video since original install. Docker Container Ubuntu. Any other
suggestions? I really appreciate the help from the board. Thank you
—
Reply to this email directly, view it on GitHub
<#1459 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AU5OHF476XSNZUZQXISUR33WTLSJXANCNFSM4KSM3ZPA>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I understand the logic behind the network suggestion. However, other remote admins have the same issue. I do appreciate your help, but I am also at a loss. Like I think I have exhausted literally every option. Thank you for your help. I am not really quite sure where to go from here. |
@BitWiseSE |
@BitWiseSE here is a YouTube video link https://youtu.be/-mgenFHmCG4 (I have tried using) |
@BitWiseSE shows up fine in edit mode |
Does this take time? like Propagation? |
I've compared yours to mine, the only difference I see is the end, it
works in live mode!
When I mention possible network issues, if that is the (unlikely) case,
it could be a problem on the server, which would impact others, not only
you. It seems like a long shot, because you are rendering it in edit
mode (well, you are rendering an image of the start of the video, not
the video itself). I just don't know where else to look.
What does your screen look like in 'live' mode? Just blank?
Here is the video while the F12 (network) debug tool is activated,
notice the 'videoplayback' and the 'waterfall' which is not showing
errors (they would be in red). Such errors could be a hint as to the
source of the problem.
Of course, if you don't see anything at all in 'live' mode, then you
won't be able to see anything in F12 debug mode either.
I assume you have tried other browsers? Is there a browser setting
perhaps that is not allowing you see your videos when being displayed
that way (embedded in Wiki). I am using Edge and Chrome on a Windows 11
client machine, and both render the video 'live'. Again, long shot, but
when you are out of ideas.... what's left.. !
Hopefully someone else has ideas to help you.
.. Bruno
…On 2023-01-20 1:54 PM, cyb3rathl3t3 wrote:
@BitWiseSE <https://github.com/BitWiseSE> shows up fine in edit mode
Opera Snapshot_2023-01-20_145334_wiki tutor com
<https://user-images.githubusercontent.com/30478520/213803282-e0671086-dc3d-48ae-8ea9-49f692be5784.png>
Just not in live mode! :-(
—
Reply to this email directly, view it on GitHub
<#1459 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AU5OHF7LPVWIQZUCUJAZMU3WTL3QNANCNFSM4KSM3ZPA>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Modules > Rendering > HTML > Allow-iFrames Should not be enabled |
No, but you have to render the pages again, do some changes and save again should do it. |
I have done everything that @cyb3rathl3t3 has described and gotten the exact same results. I'm also a little perplexed as to how this is an OPEN issue since Feb 2020, no fix, and the work-around is to open up XSS vulnerabilities, AND... still no love. I mean, video is a pretty big deal. Is the entire industry user base of this not struggling? |
@dapug Please don't misunderstand, I am sorry you are experiencing the same frustration I am. However, I am so relieved to hear that someone else is having the same issue. It is still not a functional feature on my end. As you correctly mentioned. How could this feature go on abandoned for so long? Video is an integral part of any Platform. I don't understand. |
Description:
Tested with:
@NGPixel What's the current status of this issue ? any new workarounds ? |
It's not been addressed or fixed as far as I can tell. I have been checking up on it and the issue remains. |
@cyb3rathl3t3 Work around posted here works for me, can you post pictures of your rendering HTML security settings? and your security settings? make sure you apply and refresh them. also post the theming injection screenshot? also look at the console by pressing F12 on your browser if you see any errors there. Would you be willing to share admin access to your setup or a clean one for me to check? [email protected] i've created this temporary mail for you to share the details, if you can run a new install I'll fix it on that. |
The solution with the injectable code does not work. |
Are we getting closer to a solution on this please? |
Dear @grandixximo , I used your instructions, but they didn't help me. However, with some edits, I managed to fix the error. Thank you very much!) A UFO flew by and drop this:
|
@NGPixel possible to get this feature supported in the near future? |
@8fm7 I'm glad you made it work, hopefully will help others as well. I still hope to see a native solution sooner or later... |
+1 here, would be very helpful to have a markdown way to put an uploaded video. |
+1 here :} |
+1 please just add video embedding for visual editor! Not every content creator knows about coding. |
+1 also need video to be rendered, a picture is worth 1000 words, a video is worth 1000 pictures. |
Describe the bug
Youtube embedded video is not rendered in view mode, but is ok in edit mode
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Video should be rendered for viewing, but it's invisible.
Host Info (please complete the following information):
The text was updated successfully, but these errors were encountered: