我想要的是选择“质量”的“url”值是hd720
Component
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 Call
Link
1 回答
您只需要搜索具有匹配条件的JSON数组(Using find),在这种情况下"quality" === "hd720"