The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Converting HTML4 To HTML5 Advice
homeuser
post Dec 8 2019, 07:52 PM
Post #1


Newbie
*

Group: Members
Posts: 14
Joined: 11-May 09
From: East Coast
Member No.: 8,568



This seems to be the right forum for this but I apologize if it belongs elsewhere.

For a long time I've been helping a friend with his personal, non-commercial website. Recently a problem has developed. The website has some 50+ html files, almost all of which have Flash video, some also with MP3 audio. All of the video and audio recently stopped working. They're all played in the HTML code using MC Media Player which is installed on the website. It's an orphan player, hence there isn't any support for this problem.

The player has worked for many years. The only reason I suspect for its failing is that it's related to the concerted effort to get rid of Flash video, and therefore none of the browsers (Opera, Firefox and Chrome) will play them or the flash player anymore (even for audio). I have a utility that convert's FLV to MP4, one at a time, so it's not a problem to change those files and address that part of it.

But I need two new players in the HTML code, one for video and one for audio, or one combo player, to replace the combo
MC Media Player. I haven't found one that will work in HTML4. I could use a video player, such as DVDVideoSoft Free HTML5 Video Player And Converter, and then look for an audio player (or just use the AUDIO tag). But these require converting the code to HTML5.

Therein lies the problem. I'm familiar with basic HTML but am NOT by any means an "expert". Converting 50+ files from HTML4 to HTML5 is a daunting and dismaying undertaking.

(I converted one FLV to MP4 on the website and tested it along, with an MP3, using W3Schools sample VIDEO and AUDIO "try its" and they both played, so that confirms that the problem is the player.)

Is there a utility that will read an HTML4 file and flag lines that have tags and attributes that are not HTML5 compliant? That would still leave me with a laborious, tedious and lengthy job to try to figure out their HTML5 equivalents and convert the code. But at least I would not have to read every line one-by-one, examine every tag and attribute, and guess what is not upward compatible to HTML5.

Any and all help - experience, advice, recommendations etc. - will be sincerely and greatly appreciated.
Thank you.






User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 8 2019, 09:07 PM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



Hi again. smile.gif

There indeed is such a tool. It's called a validator.

Go here.
https://validator.w3.org/

While I think it's very important with valid HTML you should know browsers don't really care about doctypes and such. If the browser supports the feature it will work no matter what doctype you put on top of your pages. If your player thing works with a HTML 5 doctype it will work with an older doctype too. So if it's important for you to get things up and running you could change the player stuff first and correct the HTML later.

Depending on what doctype you use now the HTML 5 doctype could possibly break other things on your pages since it will put browsers in Standards rendering mode. If the doctype you use now doesn't trigger Standards Mode there may be some issues. There needn't be, but just so you know this can happen if things doesn't display as usual.

I said browsers don't care about doctypes. They don't when it comes to what flavour of HTML you write. But they use the doctype as a trigger for their so called renderings modes. In Standard mode they try their best to display things according to web standards. In Quirks mode they do it as older and buggier versions of themselves.

How does your doctype look now?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Dec 9 2019, 07:08 AM
Post #3


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



QUOTE(homeuser @ Dec 9 2019, 01:52 AM) *

They're all played in the HTML code using MC Media Player which is installed on the website.

Never heard of MC Media Player, but to play Flash video you just need a browser with a Flash plugin. But like you say, Flash is not supported anymore.

QUOTE
But I need two new players in the HTML code, one for video and one for audio, or one combo player, to replace the combo
MC Media Player.

The HTML5 VIDEO or AUDIO elements should be enough. The rest is handled by the browser.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 9 2019, 07:22 AM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



Maybe he wants nice controls.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 9 2019, 07:50 AM
Post #5


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



But MC Media Player seems to be a desktop program for Windows, so I'm also confused now. cool.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
homeuser
post Dec 9 2019, 02:18 PM
Post #6


Newbie
*

Group: Members
Posts: 14
Joined: 11-May 09
From: East Coast
Member No.: 8,568



QUOTE(pandy @ Dec 8 2019, 09:07 PM) *

Hi again. smile.gif

There indeed is such a tool. It's called a validator.

Go here.
https://validator.w3.org/

While I think it's very important with valid HTML you should know browsers don't really care about doctypes and such. If the browser supports the feature it will work no matter what doctype you put on top of your pages. If your player thing works with a HTML 5 doctype it will work with an older doctype too. So if it's important for you to get things up and running you could change the player stuff first and correct the HTML later.

Depending on what doctype you use now the HTML 5 doctype could possibly break other things on your pages since it will put browsers in Standards rendering mode. If the doctype you use now doesn't trigger Standards Mode there may be some issues. There needn't be, but just so you know this can happen if things doesn't display as usual.

I said browsers don't care about doctypes. They don't when it comes to what flavour of HTML you write. But they use the doctype as a trigger for their so called renderings modes. In Standard mode they try their best to display things according to web standards. In Quirks mode they do it as older and buggier versions of themselves.


How does your doctype look now?


Thank you for replying and for your help (again).

This is the DOCTYPE:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Am I understanding you correctly that I should just try putting in DVdVideoSoft Player, or even just the VIDEO and AUDIO tags into HTML 4 and see if they work? As best I recall from the HTML5 support chart my versions of Firefox and Opera support HTML5.

Thanks for the Validator pointer. I tried testing it with one HTML file to see what it did. Now I have to try understanding what the 77 errors
and 12 warnings (!!) mean (e.g. it doesn't like some comments though they have opening/closing tags, "the validator interprets strings like <FOO /> according to legacy rules that... cause confusing warnings and error messages from the validator", the apparent requirement that ALL images must now have the ALT attribute [optional in HTML4]).


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
homeuser
post Dec 9 2019, 03:01 PM
Post #7


Newbie
*

Group: Members
Posts: 14
Joined: 11-May 09
From: East Coast
Member No.: 8,568



QUOTE(pandy @ Dec 9 2019, 07:50 AM) *

But MC Media Player seems to be a desktop program for Windows, so I'm also confused now. cool.gif


MC Media Player was written specifically for HTML use, with the player residing on the same user's website host as the user's web page calling the player. The MC Media Player's website for downloading the player no longer exists (it had been //www.mcmediaplayer.com/setup/) - it now re-routes visitors to an un-related site. . I'm attaching a JPG of part of the variables list for the HTML. And here is a sample of the HTML code to call the player - the variables precede the call in the HTML:

<script type="text/javascript" src="http://website.com/mcmediaplayer/mcmp_0.8.js"></script>

I hope this removes the confusion smile.gif Attached Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
homeuser
post Dec 9 2019, 03:07 PM
Post #8


Newbie
*

Group: Members
Posts: 14
Joined: 11-May 09
From: East Coast
Member No.: 8,568



QUOTE(pandy @ Dec 9 2019, 07:22 AM) *

Maybe he wants nice controls.


Yes - I would like nice controls to tailor, at least with the video, its presentation to the user. Not a "must have" but it's what
MC Media Player provided and it's what we've been using to make it look more professional.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 9 2019, 05:06 PM
Post #9


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



Yes. Basically slap the new stuff in and see if it works. Then, when you have the time, change the doctype to HTML 5, validate and fix the errors. With the doctype you use (a long one with URL) you shouldn't see too many display issues because of the browser modes thing, probably none.

About the many validation errors, it's more often than not the same few mistakes repeated. Did you use the validator options to override your doctype or are the errors for HTML 4.01 Transitional already?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
homeuser
post Dec 11 2019, 09:43 AM
Post #10


Newbie
*

Group: Members
Posts: 14
Joined: 11-May 09
From: East Coast
Member No.: 8,568



I didn't see any option in the Validator to override anything. Oops - I just found the override dropdown. biggrin.gif As I hadn't selected anything I expect it was for HTML 4.01 Transitional but should I select HTML5 (experimental) instead?

I'm going to change the DOCTYPE, add VIDEO and/or AUDIO Tags, then both try loading the page in a browser and running the Validator again.

By the way, do you know what <FOO /> means? "the validator interprets strings like <FOO />]..."
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 11 2019, 11:11 AM
Post #11


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



Well, then you have HTML 4.01 errors already. I'm not saying you should, but if you want to validate to HTML 4.01 as a first step you may want to try the validator at our site. It was what brought me here in the first place. I've always found it both more user friendly and a lot clearer than the the w3c one. But alas it doesn't do HTML 5. Link in the top menu under the logo.
https://htmlhelp.com/tools/validator/

<foo/>? No, not without knowing the context anyway.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
homeuser
post Dec 30 2019, 01:44 PM
Post #12


Newbie
*

Group: Members
Posts: 14
Joined: 11-May 09
From: East Coast
Member No.: 8,568



Sorry for the long delay in getting back here. Some things came up that didn't leave me time to work on this until now.

I put the <video> tag into the HTML 4 code - and it worked! Just as you said it would!! smile.gif Thank you! biggrin.gif
I tried the <audio> tag and that worked, too. So you've saved me from having to go through the HTML conversion (at least for now).

There's just one small thing that isn't working. The MC MediaPlayer used the image that was displayed before the player was started and displayed it in the player window after the file finished playing. I set the poster attribute to display an image but it does it only before the file is played. When the file finishes it just keeps displaying the last frame. Which is not how we want it to look.

Is there a simple way to get it to display the poster image - or any other image - when the file is finished playing? I don't want to have to go through the hassle of appending the poster jpg to the end of the MP4 file to get it displayed there.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jan 1 2020, 07:15 PM
Post #13


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



Dunno, I hardly ever do anything with video. But I googled and it seems it takes JavaScript and Ajax. There's an example at the bottom of this thread that seems to be accepted as a working solution.
https://stackoverflow.com/questions/1424564...-a-video-poster
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
homeuser
post Jan 1 2020, 08:53 PM
Post #14


Newbie
*

Group: Members
Posts: 14
Joined: 11-May 09
From: East Coast
Member No.: 8,568



For someone who "hardly ever does anything with video", you sure know enough about it (= plenty) to help me on what I needed to code to get around my original "flash failure" problem smile.gif As for the poster at the end that I need, I looked at the page to which you referred. As I don't know anything about how to code JavaScript, I'll have to leave the MP4 end the way it is or find a utility that can add a JPG as the last frame on the MP4 file.

Thanks again for all of your help!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jan 1 2020, 09:17 PM
Post #15


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



Ah, but that wasn't about video really. It was about HTML versions. wink.gif

Anyhow, it was this answer I meant.
https://stackoverflow.com/questions/1424564...280248#44280248

I don't think you need to do anything more than copy the two script tags, add an id to your VIDEO tag and edit the name of the id in the script in one single place if you don't want to use the dummy name the poster chose (myVideo). Can't vouch for it, but I think that's all there is to it. I understand only part of the script, but I think the objective is to reload the video when it has played without reloading the page, so the video will be in the same state it was before it played.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th March 2024 - 08:48 AM