MTVideoSource
public class MTVideoSource : MTSource, @unchecked Sendable
A video source.
The urls value is an array. For each URL in the array, a video element source will be created.
The coordinates array contains [longitude, latitude] pairs for the video corners listed in
clockwise order: top left, top right, bottom right, bottom left.
-
Unique id of the source.
Declaration
Swift
public var identifier: String -
URLs to video content in order of preferred format.
Declaration
Swift
public var urls: [URL] -
Corners of video specified as
CLLocationCoordinate2D. Clockwise order: top-left, top-right, bottom-right, bottom-left.Declaration
Swift
public var coordinates: [CLLocationCoordinate2D] -
Type of the source.
Declaration
Swift
public private(set) var type: MTSourceType { get } -
Initializes the video source with required values.
Declaration
Swift
public init(identifier: String, urls: [URL], coordinates: [CLLocationCoordinate2D])Parameters
identifierUnique id of the source.
urlsURLs to video content in order of preferred format.
coordinatesCorners of the video in clockwise order using
CLLocationCoordinate2D.
-
Updates the coordinates of the video source.
Declaration
Parameters
coordinatesNew corners of the video using
CLLocationCoordinate2D.mapViewMTMapView which holds the source.
completionHandlerA handler block to execute when function finishes.
-
setCoordinates(_:Asynchronousin: ) Updates the coordinates of the video source.
Declaration
Swift
@MainActor public func setCoordinates(_ coordinates: [CLLocationCoordinate2D], in mapView: MTMapView) asyncParameters
coordinatesNew corners of the video using
CLLocationCoordinate2D.mapViewMTMapView which holds the source.
-
Starts playback of the video source.
Declaration
Parameters
mapViewMTMapView which holds the source.
completionHandlerA handler block to execute when function finishes.
-
Pauses playback of the video source.
Declaration
Parameters
mapViewMTMapView which holds the source.
completionHandlerA handler block to execute when function finishes.
-
play(in:Asynchronous) Starts playback of the video source (async).
Declaration
Swift
@MainActor public func play(in mapView: MTMapView) async -
pause(in:Asynchronous) Pauses playback of the video source (async).
Declaration
Swift
@MainActor public func pause(in mapView: MTMapView) async
-
Adds source to map DSL style.
Prefer
addSource(_:)on MTMapView instead.Declaration
Swift
public func addToMap(_ mapView: MTMapView)