File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,12 @@ body {
7979 }
8080 }
8181 }
82+
83+ .player {
84+ padding-top : 20px ;
85+ width : $page_width * 0.75 ;
86+ height : $page_width * 0.75 * (9 / 16 );
87+ }
8288}
8389
8490.event.past {
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import * as moment from 'moment';
44import ComponentsArray from './ComponentsArray' ;
55import Countdown from './Countdown' ;
66import UiComponent from './UiComponent' ;
7+ import TwitchPlayer from './TwitchPlayer' ;
78
89export default class CurrentEvent implements UiComponent {
910 constructor ( private _event : dto . Event ) {
@@ -46,7 +47,10 @@ export default class CurrentEvent implements UiComponent {
4647 new html . Div (
4748 new html . Markdown ( `${ this . _event . description } ` ) ,
4849 { "class" : "description markdown" }
49- )
50+ ) ,
51+ // TODO: the preview twitch channel in CurrentEvent is hardcoded
52+ // It should be taken from this._event.channel
53+ new TwitchPlayer ( "tsoding" )
5054 ] ) ,
5155 {
5256 "id" : `_${ this . _event . datetime . utc ( ) . unix ( ) } ` ,
Original file line number Diff line number Diff line change 1+ import UiComponent from './UiComponent' ;
2+ import * as html from './html' ;
3+
4+ export default class TwitchPlayer implements UiComponent {
5+ constructor ( private _userName : string ) {
6+ }
7+
8+ appendTo ( entry : HTMLElement | null ) : void {
9+ new html . Tag (
10+ "iframe" ,
11+ new html . Empty ( ) ,
12+ { "src" : `https://player.twitch.tv/?channel=${ this . _userName } &muted=true` ,
13+ "allowfullscreen" : "true" ,
14+ "class" : "player" }
15+ ) . appendTo ( entry ) ;
16+ }
17+ }
You can’t perform that action at this time.
0 commit comments