Struct MediaFile

Source
pub struct MediaFile<'a> {
Show 15 fields pub id: Option<Cow<'a, str>>, pub delivery: DeliveryProtocol, pub mime_type: Cow<'a, str>, pub width: i32, pub height: i32, pub codec: Option<Cow<'a, str>>, pub bitrate: Option<i32>, pub min_bitrate: Option<i32>, pub max_bitrate: Option<i32>, pub scalable: Option<bool>, pub maintain_aspect_ratio: Option<bool>, pub file_size: Option<i32>, pub media_type: Option<Cow<'a, str>>, pub api_framework: Option<Cow<'a, str>>, pub uri: Cow<'a, str>,
}
Expand description

In VAST 4.x <MediaFile> should only be used to contain the video or audio file for a Linear ad.

<xs:element name="MediaFile">
  <xs:complexType>
    <xs:simpleContent>
      <xs:extension base="xs:anyURI">
        <xs:attribute name="id" type="xs:string" use="optional">
        <xs:attribute name="delivery" use="required">
        <xs:attribute name="type" type="xs:string" use="required">
        <xs:attribute name="width" type="xs:integer" use="required">
        <xs:attribute name="height" type="xs:integer" use="required">
        <xs:attribute name="codec" type="xs:string" use="optional">
        <xs:attribute name="bitrate" type="xs:integer" use="optional">
        <xs:attribute name="minBitrate" type="xs:integer" use="optional">
        <xs:attribute name="maxBitrate" type="xs:integer" use="optional">
        <xs:attribute name="scalable" type="xs:boolean" use="optional">
        <xs:attribute name="maintainAspectRatio" type="xs:boolean" use="optional">
        <xs:attribute name="fileSize" type="xs:integer" use="optional">
        <xs:attribute name="mediaType" type="xs:string" use="optional">
        <xs:attribute name="apiFramework" type="xs:string" use="optional">
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
</xs:element>

Fields§

§id: Option<Cow<'a, str>>

An identifier for the media file.

§delivery: DeliveryProtocol

Either “progressive” for progressive download protocols (such as HTTP) or “streaming” for streaming protocols.

§mime_type: Cow<'a, str>

MIME type for the file container. Popular MIME types include, but are not limited to “video/mp4” for MP4, “audio/mpeg” and “audio/aac” for audio ads.

§width: i32

The native width of the video file, in pixels. (0 for audio ads)

§height: i32

The native height of the video file, in pixels. (0 for audio ads)

§codec: Option<Cow<'a, str>>

The codec used to encode the file which can take values as specified by RFC 4281.

§bitrate: Option<i32>

For progressive load video or audio, the bitrate value specifies the average bitrate for the media file; otherwise the minBitrate and maxBitrate can be used together to specify the minimum and maximum bitrates for streaming videos or audio files.

§min_bitrate: Option<i32>

The minBitrate is minimum bitrate for streaming videos or audio files. Can be used with maxBitrate to specify bitrate.

§max_bitrate: Option<i32>

The maxBitrate is maximum bitrate for streaming videos or audio files. Can be used with minBitrate to specify bitrate.

§scalable: Option<bool>

A Boolean value that indicates whether the media file is meant to scale to larger dimensions.

§maintain_aspect_ratio: Option<bool>

A Boolean value that indicates whether aspect ratio for media file dimensions should be maintained when scaled to new dimensions.

§file_size: Option<i32>

Optional field that helps eliminate the need to calculate the size based on bitrate and duration. Units - Bytes

§media_type: Option<Cow<'a, str>>

Type of media file (2D / 3D / 360 / etc). Optional. Default value = 2D

§api_framework: Option<Cow<'a, str>>
👎Deprecated since VAST 4.1

Identifies the API needed to execute an interactive media file, but current support is for backward compatibility. Please use the <InteractiveCreativeFile> element to include files that require an API for execution.

§uri: Cow<'a, str>

A CDATA-wrapped URI to a media file.

Trait Implementations§

Source§

impl<'a> Clone for MediaFile<'a>

Source§

fn clone(&self) -> MediaFile<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for MediaFile<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for MediaFile<'a>

Source§

fn default() -> MediaFile<'a>

Returns the “default value” for a type. Read more
Source§

impl<'a> PartialEq for MediaFile<'a>

Source§

fn eq(&self, other: &MediaFile<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'__input: 'a, 'a> XmlRead<'__input> for MediaFile<'a>

Source§

fn from_reader(reader: &mut XmlReader<'__input>) -> XmlResult<Self>

Source§

fn from_str(text: &'a str) -> Result<Self, XmlError>

Source§

impl<'a> XmlWrite for MediaFile<'a>

Source§

fn to_writer<W: Write>(&self, writer: &mut XmlWriter<W>) -> XmlResult<()>

Source§

fn to_string(&self) -> Result<String, XmlError>

Source§

impl<'a> StructuralPartialEq for MediaFile<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for MediaFile<'a>

§

impl<'a> RefUnwindSafe for MediaFile<'a>

§

impl<'a> Send for MediaFile<'a>

§

impl<'a> Sync for MediaFile<'a>

§

impl<'a> Unpin for MediaFile<'a>

§

impl<'a> UnwindSafe for MediaFile<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> XmlReadOwned for T
where T: for<'s> XmlRead<'s>,