-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from apivideo/feat/live-restreaming
Feat/live restreaming
- Loading branch information
Showing
29 changed files
with
276 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
aae56c93a2e3a6a1d04f6bd5a6ec47ba503646799e98307d3139e8ceb92a730c | ||
3eb2afd3380a2e1194d21245be70de774173595baf3a06fefd0c9c8d1c7f7f58 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// RestreamsRequestObject.swift | ||
// | ||
// Generated by openapi-generator | ||
// https://openapi-generator.tech | ||
// | ||
|
||
import Foundation | ||
#if canImport(AnyCodable) | ||
import AnyCodable | ||
#endif | ||
|
||
/** Adding restream destinations is optional. However, if you set a restream destination, you must provide all attributes for each destination. */ | ||
public struct RestreamsRequestObject: Codable, Hashable { | ||
|
||
/** Use this parameter to define a name for the restream destination. */ | ||
public var name: String | ||
/** Use this parameter to set the RTMP URL of the restream destination. */ | ||
public var serverUrl: String | ||
/** Use this parameter to provide the unique key of the live stream that you want to restream. */ | ||
public var streamKey: String | ||
|
||
public init(name: String, serverUrl: String, streamKey: String) { | ||
self.name = name | ||
self.serverUrl = serverUrl | ||
self.streamKey = streamKey | ||
} | ||
|
||
public enum CodingKeys: String, CodingKey, CaseIterable { | ||
case name | ||
case serverUrl | ||
case streamKey | ||
} | ||
|
||
// Encodable protocol methods | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
try container.encode(name, forKey: .name) | ||
try container.encode(serverUrl, forKey: .serverUrl) | ||
try container.encode(streamKey, forKey: .streamKey) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// RestreamsResponseObject.swift | ||
// | ||
// Generated by openapi-generator | ||
// https://openapi-generator.tech | ||
// | ||
|
||
import Foundation | ||
#if canImport(AnyCodable) | ||
import AnyCodable | ||
#endif | ||
|
||
public struct RestreamsResponseObject: Codable, Hashable { | ||
|
||
/** Returns the name of a restream destination. */ | ||
public var name: String? | ||
/** Returns the RTMP URL of a restream destination. */ | ||
public var serverUrl: String? | ||
/** Returns the unique key of the live stream that is set up for restreaming. */ | ||
public var streamKey: String? | ||
|
||
public init(name: String? = nil, serverUrl: String? = nil, streamKey: String? = nil) { | ||
self.name = name | ||
self.serverUrl = serverUrl | ||
self.streamKey = streamKey | ||
} | ||
|
||
public enum CodingKeys: String, CodingKey, CaseIterable { | ||
case name | ||
case serverUrl | ||
case streamKey | ||
} | ||
|
||
// Encodable protocol methods | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
try container.encodeIfPresent(name, forKey: .name) | ||
try container.encodeIfPresent(serverUrl, forKey: .serverUrl) | ||
try container.encodeIfPresent(streamKey, forKey: .streamKey) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
Tests/TestResources/payloads/livestreams/create/responses/400-0.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type" : "https://docs.api.video/reference/invalid-attribute", | ||
"title" : "An attribute is invalid.", | ||
"status" : 400, | ||
"detail" : "This value should not be blank.", | ||
"name" : "restreams[0][name]" | ||
} |
7 changes: 7 additions & 0 deletions
7
Tests/TestResources/payloads/livestreams/create/responses/400-1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type" : "https://docs.api.video/reference/invalid-attribute", | ||
"title" : "An attribute is invalid.", | ||
"status" : 400, | ||
"detail" : "Missing app name: rtmp://[host]/[app name].", | ||
"name" : "restreams[0][serverUrl]" | ||
} |
7 changes: 7 additions & 0 deletions
7
Tests/TestResources/payloads/livestreams/create/responses/400-2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type" : "https://docs.api.video/reference/invalid-attribute", | ||
"title" : "An attribute is invalid.", | ||
"status" : 400, | ||
"detail" : "RTMP URL should have the following format: rtmp://[host]/[app name].", | ||
"name" : "restreams[0][serverUrl]" | ||
} |
7 changes: 7 additions & 0 deletions
7
Tests/TestResources/payloads/livestreams/create/responses/400-3.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type" : "https://docs.api.video/reference/invalid-attribute", | ||
"title" : "An attribute is invalid.", | ||
"status" : 400, | ||
"detail" : "This collection should contain 5 elements or less.", | ||
"name" : "restreams" | ||
} |
7 changes: 7 additions & 0 deletions
7
Tests/TestResources/payloads/livestreams/create/responses/400-4.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type" : "https://docs.api.video/reference/invalid-attribute", | ||
"title" : "An attribute is invalid.", | ||
"status" : 400, | ||
"detail" : "This value should not be null.", | ||
"name" : "restreams[0][name]" | ||
} |
27 changes: 18 additions & 9 deletions
27
Tests/TestResources/payloads/livestreams/get/responses/200.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
{ | ||
"liveStreamId" : "li400mYKSgQ6xs7taUeSaEKr", | ||
"createdAt" : "2020-01-31T10:17:47.000Z", | ||
"updatedAt" : "2020-03-09T13:19:43.000Z", | ||
"streamKey" : "30087931-229e-42cf-b5f9-e91bcc1f7332", | ||
"name" : "Live Stream From the browser", | ||
"liveStreamId" : "li4pqNqGUkhKfWcBGpZVLRY5", | ||
"createdAt" : "2020-07-29T10:45:35.000Z", | ||
"updatedAt" : "2020-07-29T10:45:35.000Z", | ||
"streamKey" : "cc1b4df0-d1c5-4064-a8f9-9f0368385135", | ||
"restreams" : [ { | ||
"name" : "YouTube", | ||
"serverUrl" : "rtmp://youtube.broadcast.example.com", | ||
"streamKey" : "cc1b4df0-d1c5-4064-a8f9-9f0368385135" | ||
}, { | ||
"name" : "Twitch", | ||
"serverUrl" : "rtmp://twitch.broadcast.example.com", | ||
"streamKey" : "cc1b4df0-d1c5-4064-a8f9-9f0368385135" | ||
} ], | ||
"name" : "Live From New York", | ||
"public" : true, | ||
"record" : true, | ||
"broadcasting" : false, | ||
"assets" : { | ||
"iframe" : "<iframe src=\"https://embed.api.video/live/li400mYKSgQ6xs7taUeSaEKr\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"></iframe>", | ||
"player" : "https://embed.api.video/live/li400mYKSgQ6xs7taUeSaEKr", | ||
"hls" : "https://live.api.video/li400mYKSgQ6xs7taUeSaEKr.m3u8", | ||
"thumbnail" : "https://cdn.api.video/live/li400mYKSgQ6xs7taUeSaEKr/thumbnail.jpg" | ||
"iframe" : "<iframe src=\"https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"></iframe>", | ||
"player" : "https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5", | ||
"hls" : "https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5.m3u8", | ||
"thumbnail" : "https://cdn.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5/thumbnail.jpg" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.