Embedding a QuickTime movie in a JSP

By: Bruce W. Perry Emailed: 1700 times Printed: 2205 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

Similar to using the Java Plug-in, a JSP uses the embed tag inside of an HTML object tag to properly load one of Apple Computer's QuickTime movies. You must include the CLASSID attribute value exactly as the below sample jsp program specifies. You also must include the same CODEBASE attribute value. If the user has an Internet Explorer Windows browser, but has not yet installed the QuickTime ActiveX control, the CODEBASE attribute value specifies where the user can download it.

Embedding a QuickTime movie in a JSP
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

<jsp:useBean id="date" class="java.util.Date" />

<html>
<head><title>QuickTime in a JSP</title></head>
<body>
<h2>Ladies and Gentlemen, The Who</h2>

<OBJECT CLASSID=
    "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="320"
    HEIGHT="256" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">

<PARAM name="SRC" VALUE="http://www.parkerriver.com/films/who_bene2.mov">

<PARAM name="AUTOPLAY" VALUE="true">

<PARAM name="CONTROLLER" VALUE="true">

<EMBED SRC=
   "http://www.parkerriver.com/films/who_bene2.mov" 
    WIDTH="240" HEIGHT="196" 
    AUTOPLAY="true" CONTROLLER=
    "true" PLUGINSPAGE="http://www.apple.com/quicktime/download/">

</EMBED>

</OBJECT>

<br /><c:out value="${date}"/>

</body>
</html>

If the browser uses Netscape-style plug-ins, then the embed tag will initiate the loading of the QuickTime movie. The JSP in above example properly loaded the movie into the Safari web browser on my Macintosh laptop, for instance. One of the advantages of the embed tag is that you can use a number of proprietary attributes that the embedded object, such as QuickTime, understands. The example above pecifies that the movie should start playing as soon as the browser has loaded enough data (AUTOPLAY="true") as well as that the browser should show the movie controls, which lets the user stop or start the movie (CONTROLLER="true").


JSP Home | All JSP Tutorials | Latest JSP Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(1)


1. View Comment

Respected sir,
I am trying to embed windows media player in my html,However there is no video shown when I click on play button , Here is my html & I have deployed my web application on tomcat .



<LINK REL=StyleSheet HREF="st.css" TYPE="text/css">
<html>
<LINK REL=StyleSheet HREF="st.css" TYPE="text/css">
<!-- jsp:include page="/pages/header_s.jsp" /-->
<body class="one">

<h6>The following files are available for viewing</h6>

<OBJECT id="VIDEO" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"
width="320" height="240">

<param name="URL" value="http://localhost:8080/drmk/tracheostomy_in_emergency.avi">

<param name="AutoStart" value="false">
<param name="ShowControls" value="true">
<param name="BufferingTime" value="2">
<param name="ShowStatusBar" value="true">
<param name="AutoSize" value="true">
<param name="InvokeURLs" value="false">
>
</OBJECT>


</body>

<table>
<tr>
<td>

</td>
</tr>
<tr>
<td>

</td>
</tr>
<tr>
<td>

</td>
</tr>
</table>
</html>



I have already placed the file Tracheostomy_in_emergency.avi file in <tomcat_home>/webapps/drmk/ folder.

I am running tomcat on windows


View Tutorial          By: arshad at 2011-10-22 17:05:21

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by Bruce W. Perry
Embedding MP3 audio file in a JSP
Embedding a QuickTime movie in a JSP
Getting HTTP Request Headers in a JSP
Using a DataSource from WebLogic in a JSP
Creating a JavaBean to Connect with Google API
Deploying an Individual JSP on Tomcat
Writing your first JSP page

More Tutorials in JSP
LifecycleException: service.getName(): "Catalina"; Protocol handler start failed: `java.net.BindException: Permission denied <null>:80
JSP Alert Example
JSP CheckBox Example
Uploading an Image to a Database using JSP
Uploading a file to a server using JSP
A JSP page that gets properties from a bean
The page Directive in JSP
The taglib, tag, include, attribute and the variable Directive in JSP
Declarations in JSP
Scriptlets and Expressions in JSP
Tag Libraries in JSP
The Request Object in JSP
The Response Object in JSP
The Out Object in JSP
The Session Object in JSP

More Latest News
Most Viewed Articles (in JSP )
The Advantages of JSP
What are the different scopes in JSP?
JSP CheckBox Example
The JSP Program running first Time.
Tags using in jsp
Combining Scriptlets with HTML
Tag libraries
A Servlet That Generates HTML
An Example Using Servlet Initialization and Page Modification Dates
Simple HTML-Building Utilities
Form Object
Retrieving a Portion of a String
Comparison operators in JSP
Automatically Including Preludes and Codas in JSP
The Tag Life Cycle with Attributes in JSP
Most Emailed Articles (in JSP)
What is JSP?
Declaring variable in JSP
A Servlet That Generates HTML
Retrieving a Portion of a String
JSP Example to connect to MS SQL database using Tomcat Connection Pool
The Application Object in JSP
Cookies using JSP or Java Bean
Click to Activate and Use this control
The JSP Program running first Time.
Scriptlets
Server Side Programming
Syntax For JSP Declaratives
Embedding java codes in jsp sciptlets
Tags using in jsp
JSP pages in servlet