import React, { Component } from 'react'; import { StyleSheet, View } from 'react-native'; import ScrollableContainer from '../components/scrollableContainer' import ClearText from '../components/text' import Button from '../components/button' import Youtube from '../components/youtube' export default class Livestream extends Component { constructor(props) { super() this.state = { ytid: isMobile ? "" : getYTID(choice(props.content.streams).uri), isReady: false, currentTime: 0, duration: 0, quality: 0, status: 'unloaded', error: null, } } render() { const buttons = this.props.content.streams.map( (stream, i) => { const ytid = getYTID(stream.uri || "") if (! ytid) return null let buttonStyle, textStyle if (ytid === this.state.ytid) { buttonStyle = styles.activeButton textStyle = styles.activeButtonText } return (