---
title: mediaFileURL
framework: messages
role: symbol
role_heading: Instance Property
path: messages/msmessagetemplatelayout/mediafileurl
---

# mediaFileURL

A media file used to represent the message in the transcript.

## Declaration

```swift
var mediaFileURL: URL? { get set }
```

## Discussion

Discussion The media file URL must be a file URL. For video files, the system crops the left and right edges of the media file by 6 points, and rounds its corners. For audio files, it shows a graphical representation of the audio’s waveform. The template can have either an image or a media file. This property is ignored if the template has a non-nil image property. This property defaults to nil.

## See Also

### Assigning Visual Elements

- [image](messages/msmessagetemplatelayout/image.md)
- [imageTitle](messages/msmessagetemplatelayout/imagetitle.md)
- [imageSubtitle](messages/msmessagetemplatelayout/imagesubtitle.md)
- [caption](messages/msmessagetemplatelayout/caption.md)
- [subcaption](messages/msmessagetemplatelayout/subcaption.md)
- [trailingCaption](messages/msmessagetemplatelayout/trailingcaption.md)
- [trailingSubcaption](messages/msmessagetemplatelayout/trailingsubcaption.md)
