You are here: Reference > JavaScript > client-side > HTML DOM > properties > loop (embed)

loop property (embed)

Browser support:
Sets or retrieves the type of repetition of the embedded media.
The embed tag is a non-standard tag in HTML but supported by all commonly used browsers.

Syntax:

object.loop;
You can find the related objects in the Supported by objects section below.
This property is read/write.
HTML page for this property: loop

Possible values:

The kind of the repetition.
One of the following values:
false
No repeat, played only once.
true
Endless repeat.
Default: false.

Example HTML code 1:

This example illustrates the use of the loop attribute:
<embed type="video/mpeg" width="320px" height="240px" src="testVideo.mpg" loop="true" />
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the loop property:
<head>
    <script type="text/javascript">
        function ChangeLoop () {
            var embed = document.getElementById ("myEmbed");

            if ('loop' in embed) {
                embed.loop = true;
            } else {
                alert ("Your browser doesn't support this example!");
            }
        }
    </script>
</head>
<body>
    <embed id="myEmbed" type="video/mpeg" width="320px" height="250px" src="testVideo.mpg" loop="true" />
    <br />
    
    <button onclick="ChangeLoop ();">Enable to repeat the video!</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content