web中链接多媒体

一、使用超链接标签<a></a>即可

<!DOCTYPE html>
<html>
<head>
<meta name="content-type" content="text/html;charset=GB2312">
<title>mediatest</title>
</head>
<body>
<h1>this is a movie.</h1>
<a href="234774718.mp4"><img src="32A58PICMpY.jpg" alt="view" width="100" height="75" style="float:left "></a>
<!--将图片作为超链接连接到视频文件-->
<p >Grumpy humans of the world, listen here. According to a new University of Otago study published in the Journal of Positive Psychology, the path to that happy state of mind you’ve heard so much about requires you get creative ― quite literally, and just once a day.
So you’re not the next Picasso. Same. But flexing your creative muscles doesn’t have to mean preparing an oeuvre for your eventual solo show. A creative exercise can take the shape of anything from kitting to writing to singing to designing. All that matters is that you choose a creative goal for yourself and follow through, something that involves expressing original ideas in a useful or artistic way.
“There is growing recognition in psychology research that creativity is associated with emotional functioning,” Dr. Conner explained in a statement. “However, most of this work focuses on how emotions benefit or hamper creativity, not whether creativity benefits or hampers emotional wellbeing.”</p>
</body>
</html>

该html文件在IE浏览器中可能出现乱码情况
这里写图片描述
只需更改一下ie浏览器的编码即可
这里写图片描述
将编码改为UTF-8,就可以解决问题了。
二、嵌入多媒体
在web页面中嵌入多媒体文件将会产生一组软件空间控件,允许直接播放文件,无需辅助窗口,也不需要导航离开所在页面。这时,需要用到<object>标签。

<!DOCTYPE html>
<html>
<head>
<meta name="content-type" content="text/html;charset=GB2312">
<title>mediatest</title>
</head>
<body>
<h1>this is a movie.</h1>
<div style="float:left">
    <object data="20165123_787918.mp4"></object>
</div>
<!--style属性包括width(播放器宽度)、height(播放器高度)、type(视频格式)、data(嵌入资源的URL),如果不设置高度宽度属性,会根据网页去适应内容。-->
<p >The old woman had only pretended to be so kind. She was in reality a wicked witch, who lay in wait for children, and had only built the little house of bread in order to entice them there. When a child fell into her power, she killed it, cooked and ate it, and that was a feast day with her.
Witches have red eyes, and cannot see far, but they have a keen scent like the beasts, and are aware when human beings draw near. When Hansel and Gretel came into her neighborhood, she laughed with malice, and said mockingly, "I have them, they shall not escape me again."</p>
</body>
</html>

三、HTML5实现web不使用外部插件播放视频或音频文件

<!DOCTYPE html>
<html>
<head>
<meta name="content-type" content="text/html;charset=GB2312">
<title>mediatest</title>
</head>
<body>
<h1 style="text-align:center">this is a movie.</h1>
<p >The old woman had only pretended to be so kind. She was in reality a wicked witch, who lay in wait for children, and had only built the little house of bread in order to entice them there. When a child fell into her power, she killed it, cooked and ate it, and that was a feast day with her.</p>
<video
src="20141123_124718.mp4"
width="400"
height="375"
preload="auto"
controls
autoplay
loop
/>
<!--视频文件video,音频文件audio,两个用法是一样的。常用的四个属性:
1、preload:是否缓冲文件,包括none(不缓冲)、auto(缓冲)、metadata(只缓冲文件的元数据)三个值
2、controls:显示用于音频播放器的控件,这样用户可以自主的暂停或者播放
3、autoplay:加载完自动播放
4、loop:循环播放-->
<p>Witches have red eyes, and cannot see far, but they have a keen scent like the beasts, and are aware when human beings draw near. When Hansel and Gretel came into her neighborhood, she laughed with malice, and said mockingly, "I have them, they shall not escape me again."</p>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值