forked from opentok/OpenTok-Ruby-SDK
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add broadcasts list REST API wrapper
- Loading branch information
1 parent
09c1672
commit 32dd5cc
Showing
9 changed files
with
214 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require "opentok/broadcast" | ||
|
||
module OpenTok | ||
# A class for accessing an array of Broadcast objects. | ||
class BroadcastList | ||
# The total number of broadcasts. | ||
attr_reader :total | ||
|
||
def initialize(interface, json) | ||
@total = json["count"] | ||
super json["items"].map { |item| ::OpenTok::Broadcast.new interface, item } | ||
end | ||
end | ||
end |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module OpenTok | ||
# @private | ||
VERSION = '4.2.0' | ||
VERSION = '4.3.0' | ||
end |
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,46 @@ | ||
<div class="container bump-me"> | ||
|
||
<div class="body-content"> | ||
|
||
<div class="panel panel-default"> | ||
<div class="panel-heading"> | ||
<h3 class="panel-title">Broadcasts List</h3> | ||
</div> | ||
<div class="panel-body"> | ||
<% if broadcasts.count > 0 %> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Created</th> | ||
<th>Status</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% for item in broadcasts %> | ||
|
||
<tr data-item-id="<%= item.id %>"> | ||
<td><%= Time.at(item.created_at/1000).strftime("%B %e, %Y at %I:%M %p") %></td> | ||
<td><%= item.status %></td> | ||
</tr> | ||
|
||
<% end %> | ||
</tbody> | ||
</table> | ||
<% else %> | ||
<p> | ||
There are no broadcasts currently. Try making one in the <a href="/host">host view</a>. | ||
</p> | ||
<% end %> | ||
</div> | ||
<div class="panel-footer"> | ||
<% if show_previous %> | ||
<a href="<%= show_previous %>" class="pull-left">← Previous</a> | ||
<% end %> | ||
| ||
<% if show_next %> | ||
<a href="<%= show_next %>" class="pull-right">Next →</a> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
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