Skip to content

Commit

Permalink
Merge pull request #27 from barmej/v1.2
Browse files Browse the repository at this point in the history
V1.1
  • Loading branch information
yjose authored May 13, 2020
2 parents 5248dd6 + 058d370 commit 7a878b1
Show file tree
Hide file tree
Showing 46 changed files with 4,812 additions and 3,555 deletions.
6 changes: 6 additions & 0 deletions example/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
root: true,
extends: '@react-native-community',
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
};
69 changes: 0 additions & 69 deletions example/.flowconfig

This file was deleted.

9 changes: 8 additions & 1 deletion example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Android/IntelliJ
#
Expand All @@ -30,6 +29,10 @@ build/
local.properties
*.iml

# Visual Studio Code
#
.vscode/

# node.js
#
node_modules/
Expand All @@ -40,6 +43,7 @@ yarn-error.log
buck-out/
\.buckd/
*.keystore
!debug.keystore

# fastlane
#
Expand All @@ -54,3 +58,6 @@ buck-out/

# Bundle artifact
*.jsbundle

# CocoaPods
/ios/Pods/
6 changes: 6 additions & 0 deletions example/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
bracketSpacing: false,
jsxBracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
};
51 changes: 25 additions & 26 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,40 @@
* @flow
*/

import React, { Component } from "react";
import { Platform, StyleSheet, Text, View } from "react-native";
import YoutubePlayer from "react-native-yt-player";
import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';
import YoutubePlayer from 'react-native-yt-player';

const TopBar = ({ play, fullScreen }) => (
const TopBar = ({play, fullScreen}) => (
<View
style={{
alignSelf: "center",
position: "absolute",
top: 0
}}
>
{!fullScreen && <Text style={{ color: "#FFF" }}> Custom Top bar</Text>}
alignSelf: 'center',
position: 'absolute',
top: 0,
}}>
{!fullScreen && <Text style={{color: '#FFF'}}> Custom Top bar</Text>}
</View>
);

export default class App extends Component<Props> {
state = {
fullScreen: false
fullScreen: false,
};

onFullScreen = fullScreen => {
console.log("fullscreen ", fullScreen);
this.setState({ fullScreen });
onFullScreen = (fullScreen) => {
console.log('fullscreen ', fullScreen);
this.setState({fullScreen});
};
render() {
return (
<View style={{ paddingTop: 60 }}>
<View style={{paddingTop: 60}}>
<YoutubePlayer
topBar={TopBar}
videoId="Z1LmpiIGYNs"
autoPlay
onFullScreen={this.onFullScreen}
onStart={() => console.log("onStart")}
onEnd={() => alert("on End")}
onStart={() => console.log('onStart')}
onEnd={() => alert('on End')}
/>

<View>
Expand All @@ -59,18 +58,18 @@ export default class App extends Component<Props> {
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
backgroundColor: "#F5FCFF"
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: "center",
margin: 10
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: "center",
color: "#333333",
marginBottom: 5
}
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
55 changes: 55 additions & 0 deletions example/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* Generated with the TypeScript template
* https://github.com/react-native-community/react-native-template-typescript
*
* @format
*/

import React from 'react';
import {SafeAreaView, StatusBar, Text, View} from 'react-native';
import YoutubePlayer from 'react-native-yt-player';

const TopBar = () => (
<View
style={{
alignSelf: 'center',
position: 'absolute',
top: 0,
}}>
<Text style={{color: '#FFF'}}> Custom Top bar</Text>
</View>
);

const App = () => {
return (
<>
<StatusBar barStyle="dark-content" />
<SafeAreaView>
<View style={{paddingTop: 60}}>
<YoutubePlayer
topBar={TopBar}
videoId="H5R9jZMBNI8"
// autoPlay
//onFullScreen={this.onFullScreen}
onStart={() => console.log('onStart')}
onEnd={() => console.log('on End')}
/>

<View>
<Text>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Commodi,
aspernatur rerum, deserunt cumque ipsam unde nam voluptatum
tenetur cupiditate veritatis autem quidem ad repudiandae sapiente
odit voluptates fugit placeat ut!
</Text>
</View>
</View>
</SafeAreaView>
</>
);
};

export default App;
14 changes: 0 additions & 14 deletions example/__tests__/App-test.js

This file was deleted.

File renamed without changes.
Loading

0 comments on commit 7a878b1

Please sign in to comment.