Skip to content

Commit

Permalink
Embedding Twitch Chat Option added to Stream/Video Component
Browse files Browse the repository at this point in the history
  • Loading branch information
Squarius committed Aug 18, 2016
1 parent 4a06e36 commit 8636ed6
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 2 deletions.
16 changes: 16 additions & 0 deletions assets/css/twitch.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,20 @@
.game .viewer {
font-size: 12px;
color: #999;
}


/*
* -----------------------
* Stream Component
* -----------------------
*/
.twitch-stream-wrap:after {
content: "";
display: block;
clear: both;
}

.twitch-stream {
float: left;
}
15 changes: 15 additions & 0 deletions components/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ public function defineProperties()
'type' => 'string',
'default' => '0.5'
],
'chat' => [
'title' => 'Chat',
'description' => 'Display Twitch Chat',
'type' => 'checkbox',
'default' => 0
]
];
}

/**
* @inheritdoc
*/
public function onRun()
{
$this->addCss('/plugins/digitalronin/twitch/assets/css/twitch.css');
}

}
16 changes: 15 additions & 1 deletion components/stream/default.htm
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
<!-- Twitch Stream/Video -->
<div id="twitch-stream-{{__SELF__.alias}}"></div>
<div class="twitch-stream-wrap">
<div class="twitch-stream" id="twitch-stream-{{__SELF__.alias}}"></div>

{% if __SELF__.property('chat') == 1 %}
<iframe class="twitch-chat"
frameborder="0"
scrolling="no"
id="chat_embed"
src="http://www.twitch.tv/{CHANNEL}/chat"
height="{{__SELF__.property('height')}}"
width="300">
</iframe>
{% endif %}
</div>


<script src= "http://player.twitch.tv/js/embed/v1.js"></script>
<script type="text/javascript">
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "digitalronin/twitch-plugin",
"type": "october-plugin",
"description": "Twitch.tv plugin for October CMS",
"homepage": "https://github.com/digital-ronin/twitch-plugin/",
"homepage": "https://github.com/digital-ronin/oc-twitch-plugin/",
"keywords": ["october", "octobercms", "twitch", "livestream", "stream"],
"license": "MIT",
"authors": [
Expand Down
1 change: 1 addition & 0 deletions updates/version.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
1.0.1: Initialize plugin.
1.0.2: Feed Component added & Bugfixes
1.1.0: Embedding Twitch Live Streams/Videos
1.1.1: Embedding Twitch Chat Option added to Stream/Video Component

0 comments on commit 8636ed6

Please sign in to comment.