Skip to content
Open
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
30 changes: 16 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,21 @@
</div>
</div>
<div class="intro">
<iframe
class="hidden"
src="http://player.twitch.tv/?channel={TWITCH_USER_NAME}"
height="100%"
width="100%"
frameborder="0"
scrolling="no"
allowfullscreen="true"
></iframe>
<div class="intro-text">
<h1>Twitch Stream offline.</h1>
<p>Stream offline. Come back later and watch me play.</p>
</div>
<script src= "http://player.twitch.tv/js/embed/v1.js"></script>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be best to have this down at the end of the file with the other JS <script> tags. Probably before the bootstrap include.

Also using https would be awesome.

<div id="{PLAYER_DIV_ID}"></div>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can just be video-player

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And with a class="hidden" so we can toggle it.

<script type="text/javascript">
var options = {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move these and the lines following to the main.js file. Also the width and height can both be 100%

width: 854,
height: 480,
channel: "{nl_kripp}",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be {TWITCH_USER_NAME}

//video: "{VIDEO_ID}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can remove this

};
var player = new Twitch.Player("{PLAYER_DIV_ID}", options);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be #video-player

player.setVolume(0.5);
player.addEventListener(Twitch.Player.PAUSE, () => { console.log('Player is paused!'); });
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this PAUSE event we can hook into the OFFLINE and ONLINE events to add / remove the hidden class on the player-video div

Much like how the main.js is interacting with the embed iframe now.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay,actually i am new to this can you explain a bit, i am familiar with js but i haven't done any projects like this ...thanks

</script>


</div>
</div>
</div>
Expand Down Expand Up @@ -142,7 +144,7 @@ <h4>Gameface vs Gamearm</h4>
</div>
<div class="col-md-4 chat">
<h2>Chat</h2>
<iframe src="https://www.twitch.tv/twitchusername/chat" frameborder="0" scrolling="no" height="500" width="100%"></iframe>
<iframe src="https://www.twitch.tv/nl_kripp/chat" frameborder="0" scrolling="no" height="500" width="100%"></iframe>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can go back to TWITCH_USER_NAME

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

</div>
</div>
<div class="row footer">
Expand Down