How to get non standard things into HTML
How to get non standard things into HTML. In this session we will learn about Objects and what they are and how to use them to integrate things that are not HTML into HTML.
Video Transcript
00:00Once upon a time, in the day of dragons and fair ladies...
00:04No, I'm kidding.
00:05So in the earlier days of the internet, there wasn't really a very strict adherence to
00:11any really standard of how to build websites.
00:14So Microsoft wanted it in one way, Netscape wanted it another way.
00:20And there was really a big fight and there was not a lot of cooperation between the
00:24different browser vendors because they really wanted to stand out and be better than the
00:27other one.
00:28So although they had the basic language that was similar, they were kind of like fighting
00:32among themselves.
00:33How could they make themselves stand out?
00:35Nothing's changed.
00:36Well, some things did change because now the W3C is basically an organization where all
00:42these different groups come together and they talk and make decisions about what will
00:46be added into the language, avoiding scenarios where each browser has a completely different
00:50experience saying that was common in the earlier days of the web.
00:55Anyways, the point that we're trying to get here is in the old days, for example, to
01:00be able to add a Flash application into your website, you had to write a lot of really crazy
01:06code to make it sure that it would work on IE and work on this and work on that.
01:12Today it's really, there's a standard operation way of working.
01:15It's much easier.
01:16The HTML5 consortium, I think they're called, said that object is going to be the way
01:22you add in things that are not part of HTML at all, that are not part of the spec, basically
01:28the stuff that are not part of your browser.
01:30So if Microsoft wants to do their own thing and Google wants to do their own thing and
01:34so on and so forth, they could do it as long as it's inside of an object tag and
01:39not a new tag that they're creating.
01:41Now historically there were other tags such as embed and object, but we're not even
01:45going to talk about history.
01:47We're only going to talk about what still exists and how do you work with these adding
01:50those external things.
01:52So just as much as we're going to show you how to do this now for an mp3 file, you could
01:57do, you could add things onto a page that are not part of the HTML, you just have to
02:01make sure that you go through check the documentation of Flash or take our course on Flash to
02:06see how you would do it and so on and so forth.
02:09So with that due and that history, let's go into our editor and see how it's done.
02:13So basically whenever you're adding something that's not part of the standard HTML, you
02:17write a new object.
02:20You close that object and that's basically a generic name for saying you're adding
02:25something that isn't really defined yet.
02:27And there are definitions that you would add and every single thing would have a different
02:30way that you define it.
02:32Now most browsers though will automatically, based on the file type, if you add a file
02:37we'll figure out what it is and try to make it work, but that doesn't mean that
02:41it would always work.
02:42So you kind of want to stay away from these stuff unless it's anything specific that
02:45you know that works such as Flash.
02:47So we're going to add an MP3 file and in my source files I've added you MP3 file, 0-geek01.mp3.
02:56Side note, today in HTML5 there's a property called sound and there's a property called
03:03video which enable you to add sound and video without needing to use third party options.
03:09But we're not going to work with that because we want to show you how to work with the
03:11object tag.
03:12So I'm going to write there's 0-geek01.mp3.
03:16That's my file.
03:17Once I've added this object that's all I really had to do, if I go into my browser on Safari
03:22and click on refresh we'll see that the 0-geek jingle is now going to play out and it was
03:27that easy.
03:28All I had to do was create the object and then send it whatever data I wanted.
03:33Now the next property that correlates to the object is the param which stands for parameter.
03:40Now the parameter basically is a self enclosed tag and you could send into it key values.
03:46The way you do it you give it a name and you give a value.
03:51So in this case with our music let's say I wanted to stop the automatic playing so I would
03:56call the auto play property and I would then set it a value of false.
04:01Now every single library has different operations so if a flash would have a lot of different
04:06configurations that you could put for flash but from the HTML perspective there's only
04:10one thing.
04:11There's param, it has name and it has value and you would put inside of the name the
04:15actual thing that you want to change and the value, the value that you wanted to change
04:19you.
04:20So in this case once we set the param of name equal auto play and its value to be false
04:25automatically when we go to Safari and click on refresh it's not going to play the music
04:29by default unless we click on the play button.
04:32Okay and with that said this is not really, when you're going to run on your local computer
04:36you might not see the same thing because it really depends on the browser that you're
04:39working with because no one said that HTML supports in the object parameter MP3.
04:46Contrary to that if you're working with the sound object which is the new HTML5 configuration
04:50which you can find in one of our follow up courses on upgrading into the HTML5 world
04:54you'll find all the information you need about how to work with those new libraries
04:58as well.
04:59Alright so that's it we're done with this session.
05:02In our next set we have only two sessions left so we're really excited, we're really
05:05getting close to the end of learning every single basic HTML property and yeah that's
05:13about it.
05:14So we'll see you in our next session.
05:15Bye bye.
