Syntax error with <video>

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
Perrorist
Propeller Head
Posts: 93
Joined: Fri Dec 02, 2016 4:04 pm
Location: Central Coast, NSW

Syntax error with <video>

Post by Perrorist »

Why do I get a warning within the Text Editor for this code:

Code: Select all

				<video width="252" height="189" controls type="video/mp4">
					<source src="video.mp4">
				</video>
The warning says "Invalid syntax on or inside " tag located on line n", where n = the closing video tag.

Ignoring the warning doesn't prevent the video displaying and operating correctly.
NorthEast
Master Propellus Maximus
Posts: 6363
Joined: Mon Mar 05, 2007 8:33 am

Re: Syntax error with <video>

Post by NorthEast »

It's because topics in Flare use XHTML, and that code might be valid HTML but is not valid XHTML.
* The attribute controls has no value, so it'd need to be something like controls=""
* The source tag is not closed, it's missing </source>

So if you copy/paste HTML code that you found somewhere, you may need to edit it to make it valid XHTML.
For info, see https://www.w3schools.com/html/html_xhtml.asp

Anyway, you don't need to manually add the code to insert video.
You can insert a link to an MP4 using Insert > Multimedia > HTML5 Movie.
That'll insert it as an object tag in the source, and Flare generates the video and source tags in the output.
Perrorist
Propeller Head
Posts: 93
Joined: Fri Dec 02, 2016 4:04 pm
Location: Central Coast, NSW

Re: Syntax error with <video>

Post by Perrorist »

I keep forgetting that it's XHTML. Thanks for the explanation.
Perrorist
Propeller Head
Posts: 93
Joined: Fri Dec 02, 2016 4:04 pm
Location: Central Coast, NSW

Re: Syntax error with <video>

Post by Perrorist »

I've tried the Insert > Multimedia > HTML5 Movie method, but the display is unconstrained. How do I apply height and width attributes? It's presently extending over the edge of its container.
Perrorist
Propeller Head
Posts: 93
Joined: Fri Dec 02, 2016 4:04 pm
Location: Central Coast, NSW

Re: Syntax error with <video>

Post by Perrorist »

Adding width="252" and height="189", which are allowable in an <object>, makes no difference.
NorthEast
Master Propellus Maximus
Posts: 6363
Joined: Mon Mar 05, 2007 8:33 am

Re: Syntax error with <video>

Post by NorthEast »

Perrorist wrote:I've tried the Insert > Multimedia > HTML5 Movie method, but the display is unconstrained. How do I apply height and width attributes? It's presently extending over the edge of its container.
When you insert (or edit) the multimedia, set the size on the Size tab.

In the code, this will add the size as a style attribute, rather than width/height.
Perrorist
Propeller Head
Posts: 93
Joined: Fri Dec 02, 2016 4:04 pm
Location: Central Coast, NSW

Re: Syntax error with <video>

Post by Perrorist »

Thanks again for your help , Dave.
Post Reply