SRC Attribute | src Property (t:ANIMATION, t:AUDIO, t:IMG, ...)

HTML (DHTML)

SRC Attribute | src Property

Internet Development Index

Sets or retrieves the source URL of the media.

Syntax

HTML<ELEMENT SRC = sURL... >
Scriptingobject.src [ = sURL ]

Possible Values

sURLString that specifies the URL of the media. The URL can be suffixed with the keyword #sami to include a .smi or .sami file type for media captioning. For more information, see Remarks.

The property is read/write. The property has no default value.

Remarks

This property is read-only when applied to the playItem object.

HTML+TIME (Timed Interactive Multimedia Extensions) 2.0 supports media that includes captioning stream technology, called Synchronized Accessible Media Interchange (SAMI). The SRC attribute of a media element can use the #sami suffix to include captioning with media playback. For more information, see Adding Closed Captions to Digital Media and Understanding SAMI 1.0.

security note Security Alert  When the #sami suffix is specified with a valid URL for the SRC attribute of a media element, the contents of the SAMI stream display as text in that element. Likewise, the stream contents can be returned as the innerText of that element. For security reasons, developers should regard the SAMI stream as user input and take routine precautions against displaying unconfirmed user input as HTML rather than text. For more information, see Security Considerations: Dynamic HTML and Security Considerations: DHTML and Default Behaviors.

Standards Information

This property is defined in Synchronized Multimedia Integration Language (SMIL) 2.0 Non-Microsoft link.

Applies To

t:ANIMATION, t:AUDIO, t:IMG, t:MEDIA, playItem, t:REF, t:VIDEO

See Also

Introduction to HTML+TIME