mirror of https://github.com/FreeTubeApp/FreeTube
Fix subscribing in channel view and properly show live video
This commit is contained in:
parent
1bf7af4c28
commit
ec310e425a
|
@ -32,6 +32,8 @@ function playVideo(videoId) {
|
|||
hideViews();
|
||||
|
||||
playerView.videoId = videoId;
|
||||
playerView.video480p = undefined;
|
||||
playerView.video720p = undefined;
|
||||
playerView.embededHtml = "<iframe width='560' height='315' src='https://www.youtube-nocookie.com/embed/" + videoId + "?rel=0' frameborder='0' allow='autoplay; encrypted-media' allowfullscreen></iframe>";
|
||||
|
||||
const checkSavedVideo = videoIsSaved(videoId);
|
||||
|
|
|
@ -11,8 +11,10 @@
|
|||
function youtubeAPI(resource, params, success) {
|
||||
params.key = settingsView.apiKey;
|
||||
|
||||
let requestUrl = 'https://www.googleapis.com/youtube/v3/' + resource + '?' + $.param(params);
|
||||
|
||||
if (useTor) {
|
||||
tor.request('https://www.googleapis.com/youtube/v3/' + resource + '?' + $.param(params), function(err, res, body) {
|
||||
tor.request(requestUrl, (err, res, body) => {
|
||||
if (!err && res.statusCode == 200) {
|
||||
success(JSON.parse(body));
|
||||
} else {
|
||||
|
@ -25,8 +27,7 @@ function youtubeAPI(resource, params, success) {
|
|||
});
|
||||
} else {
|
||||
$.getJSON(
|
||||
'https://www.googleapis.com/youtube/v3/' + resource,
|
||||
params,
|
||||
requestUrl,
|
||||
success
|
||||
).fail((xhr, textStatus, error) => {
|
||||
showToast('There was an error calling the YouTube API.');
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<span class='channelViewName'>{{name}}</span>
|
||||
<br />
|
||||
<span class='channelViewSubs'>{{subCount}} Subscribers</span>
|
||||
<div id='subscribeButton' class='channelSubButton' v-on:click='subscription(channelId);'>
|
||||
<div id='subscribeButton' class='channelSubButton' v-on:click='subscription(id);'>
|
||||
{{subButtonText}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue