Created
March 6, 2019 11:00
-
-
Save andikan/673ef1d1c38b319440d9b0a541c37eef to your computer and use it in GitHub Desktop.
react native play video/audio sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { | |
AppRegistry, | |
WebView | |
} from 'react-native'; | |
export default class Demo extends React.Component { | |
render() { | |
const source = require('./assets/player.html'); | |
return ( | |
<WebView source={source}/> | |
); | |
} | |
} | |
AppRegistry.registerComponent('Demo', () => Demo); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<key>NSAppTransportSecurity</key> | |
<dict> | |
<key>NSAllowsArbitraryLoads</key> | |
<true/> | |
</dict> | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<video width="320" height="240" controls> | |
<source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4"> | |
Your browser does not support the video tag. | |
</video> | |
<audio controls> | |
<source src="https://www.w3schools.com/html/horse.mp3" type="audio/mpeg"> | |
Your browser does not support the audio element. | |
</audio> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment