Skip to content

Commit 058d4c8

Browse files
authored
docs(example): update example video and expo go link (#26)
1 parent 3690349 commit 058d4c8

File tree

6 files changed

+42
-29
lines changed

6 files changed

+42
-29
lines changed

.changeset/nine-steaks-obey.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-native-youtube-bridge": patch
3+
---
4+
5+
docs(example): update example video and expo go link

README-ko_kr.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ React Native에서 YouTube 플레이어를 사용하려면 복잡한 설정이
2020
> 빠른 시작을 원하신다면 [예제](/example/)를 확인해보세요.
2121
2222
- [웹 데모](https://react-native-youtube-bridge.pages.dev/)
23+
- [Expo Go](https://snack.expo.dev/@harang/react-native-youtube-bridge)
24+
25+
<p align="center">
26+
<img src="./assets/example.gif" width="600" />
27+
</p>
2328

2429
## 설치
2530

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ However, there are currently no actively maintained YouTube player libraries for
2020
> For a quick start, check out the [example](/example/).
2121
2222
- [Web Demo](https://react-native-youtube-bridge.pages.dev/)
23+
- [Expo Go](https://snack.expo.dev/@harang/react-native-youtube-bridge)
24+
25+
<p align="center">
26+
<img src="./assets/example.gif" width="600" />
27+
</p>
2328

2429
## Installation
2530

assets/example.gif

33.5 MB
Loading

example/src/App.tsx

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function App() {
3030

3131
const handleReady = useCallback((playerInfo: PlayerInfo) => {
3232
console.log('Player is ready!');
33-
Alert.alert('알림', 'YouTube 플레이어가 준비되었습니다!');
33+
Alert.alert('Alert', 'YouTube player is ready!');
3434

3535
console.log('rates', playerInfo.availablePlaybackRates);
3636
console.log('vol', playerInfo.volume);
@@ -55,22 +55,22 @@ function App() {
5555

5656
switch (state) {
5757
case PlayerState.UNSTARTED:
58-
console.log('플레이어가 시작되지 않음');
58+
console.log('Player is not started');
5959
break;
6060
case PlayerState.PLAYING:
61-
console.log('비디오가 재생 중입니다');
61+
console.log('Video is playing');
6262
break;
6363
case PlayerState.PAUSED:
64-
console.log('비디오가 일시정지되었습니다');
64+
console.log('Video is paused');
6565
break;
6666
case PlayerState.BUFFERING:
67-
console.log('비디오가 버퍼링 중입니다');
67+
console.log('Video is buffering');
6868
break;
6969
case PlayerState.ENDED:
70-
console.log('비디오 재생이 완료되었습니다');
70+
console.log('Video is ended');
7171
break;
7272
case PlayerState.CUED:
73-
console.log('비디오가 큐에 준비되었습니다');
73+
console.log('Video is cued');
7474
break;
7575
}
7676
}, []);
@@ -83,7 +83,7 @@ function App() {
8383

8484
const handleError = useCallback((error: YouTubeError) => {
8585
console.error('Player error:', error);
86-
Alert.alert('에러', `플레이어 오류 (${error.code}): ${error.message}`);
86+
Alert.alert('Error', `Player error (${error.code}): ${error.message}`);
8787
}, []);
8888

8989
const handlePlaybackRateChange = useCallback((rate: number) => {
@@ -93,12 +93,10 @@ function App() {
9393

9494
const handlePlaybackQualityChange = useCallback((quality: string) => {
9595
console.log('Playback quality changed:', quality);
96-
Alert.alert('품질 변경', `재생 품질이 ${quality}로 변경되었습니다`);
9796
}, []);
9897

9998
const handleAutoplayBlocked = useCallback(() => {
10099
console.log('Autoplay was blocked');
101-
Alert.alert('알림', '자동재생이 브라우저에 의해 차단되었습니다');
102100
}, []);
103101

104102
const changePlaybackRate = (rate: number) => {
@@ -151,12 +149,12 @@ function App() {
151149
);
152150

153151
Alert.alert(
154-
'플레이어 정보',
155-
`현재 시간: ${formatTime(currentTime || 0)}\n` +
156-
`총 길이: ${formatTime(duration || 0)}\n` +
157-
`상태: ${state}\n` +
158-
`로드된 비율: ${((loaded || 0) * 100).toFixed(1)}%\n` +
159-
`URL: ${url || 'N/A'}`,
152+
'Player info',
153+
`Current time: ${formatTime(currentTime || 0)}\n` +
154+
`duration: ${formatTime(duration || 0)}\n` +
155+
`state: ${state}\n` +
156+
`loaded: ${((loaded || 0) * 100).toFixed(1)}%\n` +
157+
`url: ${url || 'N/A'}`,
160158
);
161159
} catch (error) {
162160
console.error('Error getting player info:', error);
@@ -169,7 +167,7 @@ function App() {
169167
<View style={styles.header}>
170168
<Text style={styles.title}>YouTube IFrame API Player</Text>
171169
<Text style={styles.subtitle}>Video ID: {videoId}</Text>
172-
<Text style={styles.subtitle}>재생 속도: {playbackRate}x</Text>
170+
<Text style={styles.subtitle}>Playback rate: {playbackRate}x</Text>
173171
</View>
174172

175173
<YoutubePlayer
@@ -214,7 +212,7 @@ function App() {
214212
/>
215213
<View style={[styles.bufferFill, { width: `${loadedFraction * 100}%` }]} />
216214
</View>
217-
<Text style={styles.bufferText}>버퍼: {(loadedFraction * 100).toFixed(1)}%</Text>
215+
<Text style={styles.bufferText}>Buffer: {(loadedFraction * 100).toFixed(1)}%</Text>
218216
</View>
219217

220218
<View style={styles.progressContainer}>
@@ -231,30 +229,30 @@ function App() {
231229
style={[styles.button, styles.seekButton]}
232230
onPress={() => playerRef.current?.seekTo(currentTime > 10 ? currentTime - 10 : 0)}
233231
>
234-
<Text style={styles.buttonText}>⏪ -10초</Text>
232+
<Text style={styles.buttonText}>⏪ -10s</Text>
235233
</TouchableOpacity>
236234

237235
<TouchableOpacity style={[styles.button, styles.playButton]} onPress={onPlay}>
238-
<Text style={styles.buttonText}>{isPlaying ? '⏸️ 일시정지' : '▶️ 재생'}</Text>
236+
<Text style={styles.buttonText}>{isPlaying ? '⏸️ Pause' : '▶️ Play'}</Text>
239237
</TouchableOpacity>
240238

241239
<TouchableOpacity style={[styles.button, styles.stopButton]} onPress={() => playerRef.current?.stop()}>
242-
<Text style={styles.buttonText}>⏹️ 정지</Text>
240+
<Text style={styles.buttonText}>⏹️ Stop</Text>
243241
</TouchableOpacity>
244242

245243
<TouchableOpacity
246244
style={[styles.button, styles.seekButton]}
247245
onPress={() => playerRef.current?.seekTo(currentTime + 10, true)}
248246
>
249-
<Text style={styles.buttonText}>⏭️ +10초</Text>
247+
<Text style={styles.buttonText}>⏭️ +10s</Text>
250248
</TouchableOpacity>
251249
</View>
252250

253251
<View style={styles.volumeSection}>
254-
<Text style={styles.sectionTitle}>볼륨 컨트롤</Text>
252+
<Text style={styles.sectionTitle}>Volume control</Text>
255253
<View style={styles.volumeControls}>
256254
<TouchableOpacity style={[styles.volumeButton, isMuted && styles.activeButton]} onPress={toggleMute}>
257-
<Text style={styles.buttonText}>{isMuted ? '🔇 음소거됨' : '🔊 음소거'}</Text>
255+
<Text style={styles.buttonText}>{isMuted ? '🔇 Muted' : '🔊 Unmuted'}</Text>
258256
</TouchableOpacity>
259257

260258
<TouchableOpacity style={styles.volumeButton} onPress={() => changeVolume(25)}>
@@ -269,11 +267,11 @@ function App() {
269267
<Text style={styles.buttonText}>100%</Text>
270268
</TouchableOpacity>
271269
</View>
272-
<Text style={styles.volumeText}>현재 볼륨: {volume}%</Text>
270+
<Text style={styles.volumeText}>Current volume: {volume}%</Text>
273271
</View>
274272

275273
<View style={styles.speedSection}>
276-
<Text style={styles.sectionTitle}>재생 속도</Text>
274+
<Text style={styles.sectionTitle}>Playback rate</Text>
277275
<View style={styles.speedControls}>
278276
{availableRates.map((rate) => (
279277
<TouchableOpacity
@@ -289,12 +287,12 @@ function App() {
289287

290288
<View style={styles.infoSection}>
291289
<TouchableOpacity style={[styles.button, styles.infoButton]} onPress={getPlayerInfo}>
292-
<Text style={styles.buttonText}>📊 플레이어 정보</Text>
290+
<Text style={styles.buttonText}>📊 Player info</Text>
293291
</TouchableOpacity>
294292
</View>
295293

296294
<View style={styles.videoSwitcher}>
297-
<Text style={styles.switcherTitle}>다른 비디오 테스트:</Text>
295+
<Text style={styles.switcherTitle}>Test other videos:</Text>
298296
<View style={styles.videoButtons}>
299297
<TouchableOpacity
300298
style={[styles.videoButton, videoId === 'AbZH7XWDW_k' && styles.activeVideoButton]}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-youtube-bridge",
33
"version": "0.3.0",
4-
"description": "react-native-youtube",
4+
"description": "🎥 Easy-to-use YouTube player for React Native with cross-platform support",
55
"main": "./lib/module/index.js",
66
"types": "./lib/typescript/src/index.d.ts",
77
"exports": {

0 commit comments

Comments
 (0)