insert raw html in article

I hope I am just having bad luck with my searches and someone will have an answer. I am trying to include html5 video in my articles using Sublime. No matter what I try I can't seem to force tiny_mce to allow me to create the tags correctly.

When I use the editor the markup ends up with all the flashplayer info jammed into the markup. Even manually removing this and inserting the sources doesn't seem to work right. What I wonder is if there is a way to keep the markup for a video tag from being modified.

I have it working using the video tag and multiple sources so that the page can be viewed with desktop as well as mobile browsers by including the appropriate video files. Right now I am using a normal mp4, an iphone mp4 and an ogg file. It works as intended if I drop it into a codeblock. But if I put it into an article it doesn't.

Maybe I should be looking into changing the config files for tiny mce? I'm not even sure if this is a zenphoto problem. What I end up with though, is a movie that will not display properly using the html5 video option of the movie insertion. It just uses the first video file as the src="" of the video tag.

Any help would be appreciated, even to point me in the direction to search.
Thanks.

EDIT: What I should have added is that to get it to work as I would like, I have to write the article using tinyMCE, disable the plugin, add the video tag code then never edit the article again. So if there is no better way so be it.

Comments

  • acrylian Administrator, Developer
    If you want to enter plain html TinyMCE provides a button "html" to access the source code. If you enter it directly it will of course be escaped and not working.

    Additionally you might need to allow certain html tags on the general Zenphoto options first so they are not cleared.

    But why don't you use the included jPlayer plugin that does support all that and you could use it all within the normal gallery?
  • Probably because I got so hung up on class-video and flow player I didn't even notice jPlayer. I just took a quick look and said, "hunh, didn't even notice that there."

    Yeah, I know about the html button. The problem is that even when I added the code there the video tags would become modified from what I entered. The same with the source tab from the embedded media button.

    For example, if I enter
    `











    `
    then hit update and reopen using the html button I will have,
    `

    `
    All I want is the markup I put. Handling the fall though cases isn't what I wanted the editor to do.

    Thanks for the direction Acrylian. It really is very much appreciated. I was really just overlooking that as an option. Hopefully it will work for me. I only need it to display video inline in the articles as I don't even have a gallery exactly.
  • acrylian Administrator, Developer
    Actually the code TinyMCE adds is not a bad idea as it is the recommend fallback markup for none html5 browsers if I am not mistaken (it uses its own flash player for that reason - there is also a plugin for that we don'T have enabled).

    Why it does that I have no idea. You could look at the tinymce site if that is maybe a configuration things (you can make your own config files) or a bug. Note we don't use the latest version yet as updating is a little complicated as we ship some languages and we need to test it first.

    jPlayer will not work within articles but if you use the Zenpage plugin's news section and the combinews for sized image the videos would show up "as if they were" articles. Just don't use links to the gallery albums on your site to "hide" that fact maybe.
  • Yeah, I figured out that jPlayer wouldn't work for what I wanted. Going back to trying to work things out with the config files for tinyMCE is what I am trying now. Perhaps I can change how it deals with the video tag.

    I understand why it does what it does, I just don't need it to do so. The idea with the combi-news is not bad. I didn't even consider it. Since I don't even have a gallery page nor the ability to "walk" albums from the image page hiding is not a problem.

    I had a feeling this was not really a zenphoto issue. Thanks for taking a look at it for me Acrylian, you saved me a little bit of hair pulling to get to the conclusion. The efforts are always appreciated.

    Because of the method of serving the video that I am trying all of the fallback is handled. If I can convince tinyMCE to not add all the extra code and leave my tags intact everything will be just fine.
  • Acrylian, just a friendly follow up.

    You are indeed correct that the markup (to handle non html5 browsers) is indeed the sane way to do things. The problem was that it always takes the first alt source if there is none for the source itself and places it inside the video tag as src="..." This doesn't allow the fall through to work correctly with the additional source tags. This effectively blocked my source tag cascade from serving the proper file. What would happen is the mp4 that was first would get served as flash even when there was an alternate in the proper format.

    Really this is not a zenphoto issue but a tinyMCE one. I ended up just hacking the media plugin for tinyMCE to stop putting a src attribute inside of the video tag, as well as not inserting the flash player object since this is all added later via my sublimevideo hook. I was not able to make it work perfectly but I can now just dump my desired source into the source tab of the media plugin and get the desired end result allowing me to feed video properly using html5 video is supported or the flash player that is used when not supported.

    It now works with FF, IE6-9, chrome, safari, mobile safari and android (to a degree, android is a mess when it comes to this subject).
  • acrylian Administrator, Developer
    Thanks for the follow up. So it is not possible to configure TinyMCE to not do this? Then maybe the best is to let its developers know about that. (we don't have the latest on board yet so maybe try that as well in case it already changed)
  • Not from what I could see. I spent the day reading through configuration options over there trying to find a decent way to do it and couldn't solve the issue that way. What would be best probably would be to finish making modifications that allowed for the main file/url to be left empty and not filling in the src attribute. I am adding one more alt source line in the advanced tab to do this.
    Going through the code though, it is not possible to say, "Please don't fill this in, I have other plans."
    I may try the newest version before finishing that up though just to be sure. I'll let you know if I have any luck with that.
Sign In or Register to comment.