Skip to content

Conversation

@vinitraj10
Copy link

#5

Copy link
Owner

@Friss Friss left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

I added some comments about how I'd like to see this fully implemented. Most of it is just moving some code around to fit the flow of the rest of current layout.

<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.

<p>Stream offline. Come back later and watch me play.</p>
</div>
<script src= "http://player.twitch.tv/js/embed/v1.js"></script>
<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 src= "http://player.twitch.tv/js/embed/v1.js"></script>
<div id="{PLAYER_DIV_ID}"></div>
<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%

var options = {
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}

width: 854,
height: 480,
channel: "{nl_kripp}",
//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

channel: "{nl_kripp}",
//video: "{VIDEO_ID}"
};
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

};
var player = new Twitch.Player("{PLAYER_DIV_ID}", options);
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

<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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants