Reputation: 145
i'm actually working on a Twitch clone with React, using the Twitch API.
I've barely finished my project but I have a problem with my embed, when it's a non-latin alphabet name, like "한동숙" it's not working.
I am embedding twitch with this handy tool : https://www.npmjs.com/package/react-twitch-embed-video
And it looks like this :
import React from "react";
import './Live.css';
import ReactTwitchEmbedVideo from "react-twitch-embed-video"
function Live({location }){
return(
<div className="containerLive">
<ReactTwitchEmbedVideo height="927" width="100%" channel={location.state.name} />
</div>
)
}
export default Live;
I am taking the name from location and place it in the channel, it work fine with latin alphabet name.
I know there is also the twitch embed, but it's not easy to use with react and the problem is the same :
<body> <!-- Add a placeholder for the Twitch embed -->
<div id="twitch-embed"></div>
<!-- Load the Twitch embed script -->
<script src="https://embed.twitch.tv/embed/v1.js"></script>
<!-- Create a Twitch.Embed object that will render within the "twitch-embed" root element. -->
<script type="text/javascript">
new Twitch.Embed("twitch-embed", {
width: 854,
height: 480,
channel: "한동숙" // <-- Not Working !
});
</script>
<script src="app.js"></script>
</body>
Unfortunatly there is no way to display stream with user_id, just user_name ...
DO i need translate it in some way ? How twitch can display asian stream ?
Thank's if someone is passing by, there is litteraly no questions on that topic.
Upvotes: 1
Views: 365
Reputation: 15
You should use "name" field instead "display_name". Name = login. It's always latinian alphabet.
Hope i helped you.
Upvotes: 1