search
HomeWeb Front-endHTML TutorialHow to use the flash plug-in to call the PC's camera and embed it into the TML page_HTML/Xhtml_Web page production

Foreword

The reason why I wrote this article is mainly because of a new requirement raised by the team leader - to use the browser to call the computer's camera to realize the function of taking pictures instantly. I checked a lot of information on the Internet, and for one reason or another, I finally chose to use a flash plug-in to call the PC's camera. Of course, this requirement is based on B/S architecture, so I am thinking about how to embed it into the front-end HTML page.

Digression

Of course, encapsulation has not been considered here. It is mainly for implementation first, and subsequent work will be abstracted according to the business and encapsulated into general components. . Okay, without further ado, let’s focus on the key points.

Embed plugin

Use object and embed tags

Code display

Copy code
The code is as follows:


codebase="http:// fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
width="490" height="390" id="Untitled-1" align= "middle">




type="application/x-shockwave-flash" pluginspage=" http://www.macromedia.com/go/getflashplayer" />



This method The Object and Embed tags are used. You can see that many parameters of object and many attributes of embed are repeated. Browser compatibility, some browsers support object, and some support embed, which is why you need to change both places when you want to modify Flash parameters. This method has always been the official method of Macromedia, ensuring the functionality of Flash to the greatest extent without compatibility issues.

But looking at it now, it still has big problems.

First of all, it fails the verification because the embed tag embedded for compatibility does not comply with the W3C specification. Of course, if you don’t care about the rules or regulations, that’s another matter.

Secondly, due to various reasons, Microsoft has restricted the usage mode of IE's ActiveX after sp2. That is, there is a virtual box in the ActiveX on the page, which requires the user to click once for normal interaction. Flash is embedded into the web page as an ActiveX, so it will also be affected. Only embedding Flash through JS can solve this problem.

Again, there is no Flash version detection. If the flash plug-in version of the browser is not enough, or your swf file cannot be displayed normally, or an ActiveX installation confirmation box will pop up - this box is annoying to many users. It's scary to say.

Only use object tag

Code display

Copy code
The code is as follows:




How to use the flash plug-in to call the PC's camera and embed it into the TML page_HTML/Xhtml_Web page productionwidth="550" style="max-width:90%" alt= "" />



This method only uses the Object tag, which is actually Flash satay. Since there is no embed tag, it can pass the verification. It is a standard method of embedding Flash. The browser compatibility is also good. It looks almost perfect, but there are still problems.

First of all, a holder swf is needed to load. Your target swf ensures the stream capability in IE. If you need to pass parameters through flashvars or interact with the JS of the page, it will be very troublesome.

Secondly, like the first method, it will also pop up. An ActiveX prompt box without version detection.

Again, some lower version browsers (such as lower versions of Safari, etc.) do not agree with this method and are not compatible with it.

Only use embed tags

Code display

Copy code
Code As follows:





This method only uses the Embed tag. In terms of comparative effects, it is still very good. Browser compatibility is also pretty good, and everything can be loaded. Of course, since the embed tag does not comply with W3C specifications, this method is not recommended.

Use JavaScript to embed

Use JS to load Flash plug-ins. There are many methods on the Internet, and there are also many good JS plug-ins for everyone to choose from. I will only use SWFObject to briefly introduce it here.

First, you need to download a SWFObject plug-in package, which contains a JS script. This is the script file you need to import. It also includes two html examples that you can imitate. Of course, you can also go to the SWFObject website to learn more. Please click here.

Code display

Copy code
The code is as follows:

< ;span style="font-family:Microsoft YaHei;">



Copy code
The code is as follows:








Alternative content


Get Adobe Flash player









Rendering

Conclusion
Comparing these methods, I prefer to use the JS embedding method to load the Flash plug-in. This method not only ensures that all functions of Flash are realized, but also can be used in every browser. The compatibility of browsers is also good, and JS can also provide more extended functions, and more importantly, it can be reused by more people, reducing unnecessary redundant code.

Plug-in download address: SWFObject
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
谷歌浏览器不支持flash插件怎么办谷歌浏览器不支持flash插件怎么办Mar 05, 2024 pm 10:40 PM

谷歌浏览器不支持flash插件怎么办?如今不少用户都在使用谷歌浏览器,部分用户在使用谷歌浏览器的是偶会弹出提示“AdobeFlashPlayer已被屏蔽”页面,这种情况下我们需要在设置里手动打开FlashPlayer,那么具体的操作方法是什么呢?相信大家都想知道吧。下面就让小编给大家说说解决不支持flash插件问题方法介绍,有需要的朋友赶紧来学习一下吧。解决不支持flash插件问题方法介绍1、点击谷歌浏览器右上角图标,如图所示。2、在跳出的对话框中单击设置,如图所示。3、点击隐私设置和安全性,然

Edge浏览器flash插件不能自动播放视频怎么办?Edge浏览器flash插件不能自动播放视频怎么办?Mar 14, 2024 am 08:10 AM

  我们很多用户在使用Edge浏览器的时候都安装了flash插件,但是还是无法自动播放视频,需要用户手动在进行操作,那么要怎么设置才能够自动播放,针对这个问题,本期小编就来分享两种操作方法,希望今天的软件教程内容能够帮助各位解决问题。  Edge浏览器flash插件不能自动播放解决方法:  方法一:  1、双击进入软件,点击页面中的“...”按钮。  2、在下方给出的选项列表中选择“设置”。  3、点击新界面中的“高级”选项。  4、

QQ浏览器提示未安装flash插件怎么办QQ浏览器提示未安装flash插件怎么办Mar 13, 2024 pm 04:58 PM

QQ浏览器提示未安装flash插件怎么办?flash插件是能够支持大家在浏览器里查看图片和视频的,一般情况下浏览器里自带有flash插件,不过最近有不少QQ浏览器用户在使用的时候页面提示未安装flash插件,导致很多内容无法正常显示,那么我们如何解决这个问题呢。接下来小编就给大家带来QQ浏览器未安装flash插件解决方案,希望能够对大家有所帮助。QQ浏览器未安装flash插件解决方案1、打开QQ浏览器,如图点击右上角的“菜单”图标,如下图所示。2、这时会弹出一个二级菜单,将鼠标移动到“工具”这一

火狐浏览器怎样安装flash插件火狐浏览器怎样安装flash插件Jan 30, 2024 pm 10:57 PM

火狐浏览器怎样安装flash插件?我们要如何在火狐浏览器里安装flash插件,具体的方法步骤是什么!我们在使用火狐浏览器观看电影,玩游戏的时候,网页都会提示我们要安装flash插件才能正常使用,那么我们应该如何安装这个插件呢,具体的操作方法是什么,小编下面正整理了火狐浏览器安装flash插件方法步骤,如果你不会操作的话,就跟着我我往下看吧!火狐浏览器怎样安装flash插件1、百度搜索adobeflashplayer官网,点击进入,如下图所示2、进入flash插件安装页面,点击【立即安装】3、、f

谷歌浏览器如何安装flash插件谷歌浏览器如何安装flash插件Mar 23, 2024 am 11:31 AM

谷歌浏览器如何安装flash插件?在大部分浏览器中都需要安装flash插件,这个插件支持图片和视频等多媒体的阅读,用户想要在谷歌浏览器里查看图片或者视频就需要安装flash插件,不少用户对这个插件并不了解,具体在谷歌浏览器里如何安装很多人都不知道。接下来小编就给大家带来谷歌浏览器安装flash插件操作步骤,有需要的朋友不妨来看看了解一下。谷歌浏览器安装flash插件操作步骤1、我们在百度搜索框中输入adobeflashplayer官方下载,我们点击可以下载的链接进去(如图所示)。2、我们在点击“

edge浏览器flash插件怎么启用?edge浏览器flash插件启用教程edge浏览器flash插件怎么启用?edge浏览器flash插件启用教程Mar 13, 2024 pm 06:30 PM

  edge浏览器怎么启用flash?在使用edge浏览器的时候如果想要启用flash应该怎么操作?使用edge浏览器看电视和玩游戏的时候,都需要用到flash这个功能,小编下面整理了edge浏览器启用flash具体步骤,有需要的小伙伴一起往下看看吧。  启用方法  1、进入浏览器,点击页面上方工具栏右侧的三个点图标。  2、接着在下方给出的选项菜单中选择“设置”。  3、进入新界面后,点击“默认浏览器”选项,然后在右侧中找到“允许在Intern

如何在Edge浏览器中安装Flash插件?如何在Edge浏览器中安装Flash插件?Jan 30, 2024 am 11:15 AM

edge浏览器怎么安装flash插件?在用户使用浏览器上网过程中,flash插件发挥着很大的作用,它能够帮助用户加载图片、视频等等的内容,帮助用户更加便利的上网。edge浏览器为用户提供了添加插件的功能,那么用户如何在edge浏览器上面添加flash插件呢?没有操作过的用户也许不懂,那么今天小编就给大家带来了非常详细的微软浏览器安装flash插件技巧,感兴趣的话就来一起学习吧。微软浏览器安装flash插件技巧1、进入免费的微软浏览器,点击页面顶部工具栏中的三个点图标,如下图所示。2、在下方给出的

火狐浏览器没有flash插件怎么办火狐浏览器没有flash插件怎么办Apr 03, 2024 pm 01:40 PM

火狐浏览器没有flash插件怎么办?火狐浏览器具有非常稳定的特性,不少用户喜欢使用这款浏览器办公,我们在浏览器里浏览图片或者视频的时候需要flash插件支持,部分用户在查看图片的时显示没有flash插件,这种情况我们需要在火狐浏览器里安装一个flash插件。接下来小编就给大家带来火狐浏览器解决没有flash插件问题详细教程,感兴趣的朋友快来看看吧。火狐浏览器解决没有flash插件问题详细教程首先,您需要将Firefox浏览器点开,然后在页面的右上角的地方将【扩展】图标按钮点击打开,接着进入到扩展

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Atom editor mac version download

Atom editor mac version download

The most popular open source editor