componentDidMount() { return fetch('https://you-link.herokuapp.com/?url=https://www.youtube.com/watch?v=YGCLs9Bt_KY') .then((response) => response.json()) .then((responseJson) => { this.setState({ isLoading: false, dataSource: responseJson, videoUrl: responseJson[0].url }, function() { }); }) .catch((error) => { console.error(error); }); }
Json调用
链接
find
:responseJson.find(obj => obj.quality === "hd720").url
- Tholle