Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Swift/SGAIClientSideExample/app/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,13 @@ class ViewController:
let encodedAuthToken = authToken.addingPercentEncoding(withAllowedCharacters: components) ?? ""

guard
let adPodManifestUrl = URL(
string:
"https://dai.google.com/linear/pods/v1/hls/network/\(StreamParameters.networkCode)/custom_asset/\(StreamParameters.customAssetKey)/\(adPodIdentifier).m3u8?stream_id=\(streamID)&pd=\(StreamParameters.adBreakDurationMs)&auth-token=\(encodedAuthToken)"
)
else {
let adPodManifestUrlString =
"https://dai.google.com/linear/pods/v1/hls/network/"
+ "\(StreamParameters.networkCode)/custom_asset/"
+ "\(StreamParameters.customAssetKey)/\(adPodIdentifier).m3u8"
+ "?stream_id=\(streamID)&pd=\(StreamParameters.adBreakDurationMs)"

guard let adPodManifestUrl = URL(string: adPodManifestUrlString) else {
// If URL creation fails, verify that StreamParameters and streamID are not empty.
print("Failed to generate the ad pod manifest URL. Skipping insertion of \(adPodIdentifier).")
return
Expand Down
Loading