mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-13 00:36:07 +05:30
Merge branch 'master' of https://github.com/omarroth/invidious
This commit is contained in:
commit
c0e73e71c5
274
locales/eu.json
Normal file
274
locales/eu.json
Normal file
@ -0,0 +1,274 @@
|
|||||||
|
{
|
||||||
|
"`x` subscribers": "",
|
||||||
|
"`x` videos": "",
|
||||||
|
"LIVE": "",
|
||||||
|
"Shared `x` ago": "",
|
||||||
|
"Unsubscribe": "",
|
||||||
|
"Subscribe": "Harpidetu",
|
||||||
|
"Login to subscribe to `x`": "",
|
||||||
|
"View channel on YouTube": "Ikusi kanala YouTuben",
|
||||||
|
"newest": "berrienak",
|
||||||
|
"oldest": "zaharrenak",
|
||||||
|
"popular": "ospetsuenak",
|
||||||
|
"Preview page": "Aurrebista orria",
|
||||||
|
"Next page": "Hurrengo orria",
|
||||||
|
"Clear watch history?": "Garbitu ikusitakoen historia?",
|
||||||
|
"Yes": "Bai",
|
||||||
|
"No": "Ez",
|
||||||
|
"Import and Export Data": "Datuak inportatu eta esportatu",
|
||||||
|
"Import": "Inportatu",
|
||||||
|
"Import Invidious data": "Invidiouseko datuak inportatu",
|
||||||
|
"Import YouTube subscriptions": "YouTubeko harpidetzak inportatu",
|
||||||
|
"Import FreeTube subscriptions (.db)": "FreeTubeko harpidetzak inportatu (.db)",
|
||||||
|
"Import NewPipe subscriptions (.json)": "NewPipeko harpidetzak inportatu (.json)",
|
||||||
|
"Import NewPipe data (.zip)": "NewPipeko datuak inportatu (.zip)",
|
||||||
|
"Export": "Esportatu",
|
||||||
|
"Export subscriptions as OPML": "Esportatu harpidetzak OPML bezala",
|
||||||
|
"Export subscriptions as OPML (for NewPipe & FreeTube)": "",
|
||||||
|
"Export data as JSON": "",
|
||||||
|
"Delete account?": "Kontua ezabatu?",
|
||||||
|
"History": "Historia",
|
||||||
|
"Previous page": "Aurreko orria",
|
||||||
|
"An alternative front-end to YouTube": "",
|
||||||
|
"JavaScript license information": "",
|
||||||
|
"source": "",
|
||||||
|
"Login": "",
|
||||||
|
"Login/Register": "",
|
||||||
|
"Login to Google": "",
|
||||||
|
"User ID:": "",
|
||||||
|
"Password:": "",
|
||||||
|
"Time (h:mm:ss):": "",
|
||||||
|
"Text CAPTCHA": "",
|
||||||
|
"Image CAPTCHA": "",
|
||||||
|
"Sign In": "",
|
||||||
|
"Register": "",
|
||||||
|
"Email:": "",
|
||||||
|
"Google verification code:": "",
|
||||||
|
"Preferences": "",
|
||||||
|
"Player preferences": "",
|
||||||
|
"Always loop: ": "",
|
||||||
|
"Autoplay: ": "",
|
||||||
|
"Autoplay next video: ": "",
|
||||||
|
"Listen by default: ": "",
|
||||||
|
"Default speed: ": "",
|
||||||
|
"Preferred video quality: ": "",
|
||||||
|
"Player volume: ": "",
|
||||||
|
"Default comments: ": "",
|
||||||
|
"Default captions: ": "",
|
||||||
|
"Fallback captions: ": "",
|
||||||
|
"Show related videos? ": "",
|
||||||
|
"Visual preferences": "",
|
||||||
|
"Dark mode: ": "",
|
||||||
|
"Thin mode: ": "",
|
||||||
|
"Subscription preferences": "",
|
||||||
|
"Redirect homepage to feed: ": "",
|
||||||
|
"Number of videos shown in feed: ": "",
|
||||||
|
"Sort videos by: ": "",
|
||||||
|
"published": "",
|
||||||
|
"published - reverse": "",
|
||||||
|
"alphabetically": "",
|
||||||
|
"alphabetically - reverse": "",
|
||||||
|
"channel name": "",
|
||||||
|
"channel name - reverse": "",
|
||||||
|
"Only show latest video from channel: ": "",
|
||||||
|
"Only show latest unwatched video from channel: ": "",
|
||||||
|
"Only show unwatched: ": "",
|
||||||
|
"Only show notifications (if there are any): ": "",
|
||||||
|
"Data preferences": "",
|
||||||
|
"Clear watch history": "",
|
||||||
|
"Import/Export data": "",
|
||||||
|
"Manage subscriptions": "",
|
||||||
|
"Watch history": "",
|
||||||
|
"Delete account": "",
|
||||||
|
"Save preferences": "",
|
||||||
|
"Subscription manager": "",
|
||||||
|
"`x` subscriptions": "",
|
||||||
|
"Import/Export": "",
|
||||||
|
"unsubscribe": "",
|
||||||
|
"Subscriptions": "",
|
||||||
|
"`x` unseen notifications": "",
|
||||||
|
"search": "",
|
||||||
|
"Sign out": "",
|
||||||
|
"Released under the AGPLv3 by Omar Roth.": "",
|
||||||
|
"Source available here.": "",
|
||||||
|
"View JavaScript license information.": "",
|
||||||
|
"Trending": "",
|
||||||
|
"Watch video on Youtube": "",
|
||||||
|
"Genre: ": "",
|
||||||
|
"License: ": "",
|
||||||
|
"Family friendly? ": "",
|
||||||
|
"Wilson score: ": "",
|
||||||
|
"Engagement: ": "",
|
||||||
|
"Whitelisted regions: ": "",
|
||||||
|
"Blacklisted regions: ": "",
|
||||||
|
"Shared `x`": "",
|
||||||
|
"Hi! Looks like you have JavaScript disabled. Click here to view comments, keep in mind it may take a bit longer to load.": "",
|
||||||
|
"View YouTube comments": "",
|
||||||
|
"View more comments on Reddit": "",
|
||||||
|
"View `x` comments": "",
|
||||||
|
"View Reddit comments": "",
|
||||||
|
"Hide replies": "",
|
||||||
|
"Show replies": "",
|
||||||
|
"Incorrect password": "",
|
||||||
|
"Quota exceeded, try again in a few hours": "",
|
||||||
|
"Unable to login, make sure two-factor authentication (Authenticator or SMS) is enabled.": "",
|
||||||
|
"Invalid TFA code": "",
|
||||||
|
"Login failed. This may be because two-factor authentication is not enabled on your account.": "",
|
||||||
|
"Invalid answer": "",
|
||||||
|
"Invalid CAPTCHA": "",
|
||||||
|
"CAPTCHA is a required field": "",
|
||||||
|
"User ID is a required field": "",
|
||||||
|
"Password is a required field": "",
|
||||||
|
"Invalid username or password": "",
|
||||||
|
"Please sign in using 'Sign in with Google'": "",
|
||||||
|
"Password cannot be empty": "",
|
||||||
|
"Password cannot be longer than 55 characters": "",
|
||||||
|
"Please sign in": "",
|
||||||
|
"Invidious Private Feed for `x`": "",
|
||||||
|
"channel:`x`": "",
|
||||||
|
"Deleted or invalid channel": "",
|
||||||
|
"This channel does not exist.": "",
|
||||||
|
"Could not get channel info.": "",
|
||||||
|
"Could not fetch comments": "",
|
||||||
|
"View `x` replies": "",
|
||||||
|
"`x` ago": "",
|
||||||
|
"Load more": "",
|
||||||
|
"`x` points": "",
|
||||||
|
"Could not create mix.": "",
|
||||||
|
"Playlist is empty": "",
|
||||||
|
"Invalid playlist.": "",
|
||||||
|
"Playlist does not exist.": "",
|
||||||
|
"Could not pull trending pages.": "",
|
||||||
|
"Hidden field \"challenge\" is a required field": "",
|
||||||
|
"Hidden field \"token\" is a required field": "",
|
||||||
|
"Invalid challenge": "",
|
||||||
|
"Invalid token": "",
|
||||||
|
"Invalid user": "",
|
||||||
|
"Token is expired, please try again": "",
|
||||||
|
"English": "",
|
||||||
|
"English (auto-generated)": "",
|
||||||
|
"Afrikaans": "",
|
||||||
|
"Albanian": "",
|
||||||
|
"Amharic": "",
|
||||||
|
"Arabic": "",
|
||||||
|
"Armenian": "",
|
||||||
|
"Azerbaijani": "",
|
||||||
|
"Bangla": "",
|
||||||
|
"Basque": "",
|
||||||
|
"Belarusian": "",
|
||||||
|
"Bosnian": "",
|
||||||
|
"Bulgarian": "",
|
||||||
|
"Burmese": "",
|
||||||
|
"Catalan": "",
|
||||||
|
"Cebuano": "",
|
||||||
|
"Chinese (Simplified)": "",
|
||||||
|
"Chinese (Traditional)": "",
|
||||||
|
"Corsican": "",
|
||||||
|
"Croatian": "",
|
||||||
|
"Czech": "",
|
||||||
|
"Danish": "",
|
||||||
|
"Dutch": "",
|
||||||
|
"Esperanto": "",
|
||||||
|
"Estonian": "",
|
||||||
|
"Filipino": "",
|
||||||
|
"Finnish": "",
|
||||||
|
"French": "",
|
||||||
|
"Galician": "",
|
||||||
|
"Georgian": "",
|
||||||
|
"German": "",
|
||||||
|
"Greek": "",
|
||||||
|
"Gujarati": "",
|
||||||
|
"Haitian Creole": "",
|
||||||
|
"Hausa": "",
|
||||||
|
"Hawaiian": "",
|
||||||
|
"Hebrew": "",
|
||||||
|
"Hindi": "",
|
||||||
|
"Hmong": "",
|
||||||
|
"Hungarian": "",
|
||||||
|
"Icelandic": "",
|
||||||
|
"Igbo": "",
|
||||||
|
"Indonesian": "",
|
||||||
|
"Irish": "",
|
||||||
|
"Italian": "",
|
||||||
|
"Japanese": "",
|
||||||
|
"Javanese": "",
|
||||||
|
"Kannada": "",
|
||||||
|
"Kazakh": "",
|
||||||
|
"Khmer": "",
|
||||||
|
"Korean": "",
|
||||||
|
"Kurdish": "",
|
||||||
|
"Kyrgyz": "",
|
||||||
|
"Lao": "",
|
||||||
|
"Latin": "",
|
||||||
|
"Latvian": "",
|
||||||
|
"Lithuanian": "",
|
||||||
|
"Luxembourgish": "",
|
||||||
|
"Macedonian": "",
|
||||||
|
"Malagasy": "",
|
||||||
|
"Malay": "",
|
||||||
|
"Malayalam": "",
|
||||||
|
"Maltese": "",
|
||||||
|
"Maori": "",
|
||||||
|
"Marathi": "",
|
||||||
|
"Mongolian": "",
|
||||||
|
"Nepali": "",
|
||||||
|
"Norwegian": "",
|
||||||
|
"Nyanja": "",
|
||||||
|
"Pashto": "",
|
||||||
|
"Persian": "",
|
||||||
|
"Polish": "",
|
||||||
|
"Portuguese": "",
|
||||||
|
"Punjabi": "",
|
||||||
|
"Romanian": "",
|
||||||
|
"Russian": "",
|
||||||
|
"Samoan": "",
|
||||||
|
"Scottish Gaelic": "",
|
||||||
|
"Serbian": "",
|
||||||
|
"Shona": "",
|
||||||
|
"Sindhi": "",
|
||||||
|
"Sinhala": "",
|
||||||
|
"Slovak": "",
|
||||||
|
"Slovenian": "",
|
||||||
|
"Somali": "",
|
||||||
|
"Southern Sotho": "",
|
||||||
|
"Spanish": "",
|
||||||
|
"Spanish (Latin America)": "",
|
||||||
|
"Sundanese": "",
|
||||||
|
"Swahili": "",
|
||||||
|
"Swedish": "",
|
||||||
|
"Tajik": "",
|
||||||
|
"Tamil": "",
|
||||||
|
"Telugu": "",
|
||||||
|
"Thai": "",
|
||||||
|
"Turkish": "",
|
||||||
|
"Ukrainian": "",
|
||||||
|
"Urdu": "",
|
||||||
|
"Uzbek": "",
|
||||||
|
"Vietnamese": "",
|
||||||
|
"Welsh": "",
|
||||||
|
"Western Frisian": "",
|
||||||
|
"Xhosa": "",
|
||||||
|
"Yiddish": "",
|
||||||
|
"Yoruba": "",
|
||||||
|
"Zulu": "",
|
||||||
|
"`x` years": "",
|
||||||
|
"`x` months": "",
|
||||||
|
"`x` weeks": "",
|
||||||
|
"`x` days": "",
|
||||||
|
"`x` hours": "",
|
||||||
|
"`x` minutes": "",
|
||||||
|
"`x` seconds": "",
|
||||||
|
"Fallback comments: ": "",
|
||||||
|
"Popular": "",
|
||||||
|
"Top": "",
|
||||||
|
"About": "",
|
||||||
|
"Rating: ": "",
|
||||||
|
"Language: ": "",
|
||||||
|
"Default": "",
|
||||||
|
"Music": "",
|
||||||
|
"Gaming": "",
|
||||||
|
"News": "",
|
||||||
|
"Movies": "",
|
||||||
|
"Download": "",
|
||||||
|
"Download as: ": ""
|
||||||
|
}
|
@ -153,12 +153,12 @@
|
|||||||
"Token is expired, please try again": "Срок действия токена истек, попробуйте позже",
|
"Token is expired, please try again": "Срок действия токена истек, попробуйте позже",
|
||||||
"English": "Английский",
|
"English": "Английский",
|
||||||
"English (auto-generated)": "Английский (созданы автоматически)",
|
"English (auto-generated)": "Английский (созданы автоматически)",
|
||||||
"Afrikaans": "",
|
"Afrikaans": "Африкаанс",
|
||||||
"Albanian": "",
|
"Albanian": "Албанский",
|
||||||
"Amharic": "",
|
"Amharic": "Амхарский",
|
||||||
"Arabic": "",
|
"Arabic": "Арабский",
|
||||||
"Armenian": "",
|
"Armenian": "Армянский",
|
||||||
"Azerbaijani": "",
|
"Azerbaijani": "Азербайджанский",
|
||||||
"Bangla": "",
|
"Bangla": "",
|
||||||
"Basque": "",
|
"Basque": "",
|
||||||
"Belarusian": "",
|
"Belarusian": "",
|
||||||
@ -256,7 +256,7 @@
|
|||||||
"Xhosa": "",
|
"Xhosa": "",
|
||||||
"Yiddish": "",
|
"Yiddish": "",
|
||||||
"Yoruba": "",
|
"Yoruba": "",
|
||||||
"Zulu": "",
|
"Zulu": "Зулусский",
|
||||||
"`x` years": "`x` лет",
|
"`x` years": "`x` лет",
|
||||||
"`x` months": "`x` месяцев",
|
"`x` months": "`x` месяцев",
|
||||||
"`x` weeks": "`x` недель",
|
"`x` weeks": "`x` недель",
|
||||||
@ -270,11 +270,11 @@
|
|||||||
"About": "О сайте",
|
"About": "О сайте",
|
||||||
"Rating: ": "Рейтинг: ",
|
"Rating: ": "Рейтинг: ",
|
||||||
"Language: ": "Язык: ",
|
"Language: ": "Язык: ",
|
||||||
"Default": "",
|
"Default": "По-умолчанию",
|
||||||
"Music": "",
|
"Music": "Музыка",
|
||||||
"Gaming": "",
|
"Gaming": "Игры",
|
||||||
"News": "",
|
"News": "Новости",
|
||||||
"Movies": "",
|
"Movies": "Фильмы",
|
||||||
"Download": "",
|
"Download": "Скачать",
|
||||||
"Download as: ": ""
|
"Download as: ": "Скачать как: "
|
||||||
}
|
}
|
||||||
|
@ -1128,21 +1128,21 @@ post "/preferences" do |env|
|
|||||||
listen = listen == "on"
|
listen = listen == "on"
|
||||||
|
|
||||||
speed = env.params.body["speed"]?.try &.as(String).to_f?
|
speed = env.params.body["speed"]?.try &.as(String).to_f?
|
||||||
speed ||= 1.0
|
speed ||= DEFAULT_USER_PREFERENCES.speed
|
||||||
|
|
||||||
quality = env.params.body["quality"]?.try &.as(String)
|
quality = env.params.body["quality"]?.try &.as(String)
|
||||||
quality ||= "hd720"
|
quality ||= DEFAULT_USER_PREFERENCES.quality
|
||||||
|
|
||||||
volume = env.params.body["volume"]?.try &.as(String).to_i?
|
volume = env.params.body["volume"]?.try &.as(String).to_i?
|
||||||
volume ||= 100
|
volume ||= DEFAULT_USER_PREFERENCES.volume
|
||||||
|
|
||||||
comments_0 = env.params.body["comments_0"]?.try &.as(String) || "youtube"
|
comments_0 = env.params.body["comments_0"]?.try &.as(String) || DEFAULT_USER_PREFERENCES.comments[0]
|
||||||
comments_1 = env.params.body["comments_1"]?.try &.as(String) || ""
|
comments_1 = env.params.body["comments_1"]?.try &.as(String) || DEFAULT_USER_PREFERENCES.comments[1]
|
||||||
comments = [comments_0, comments_1]
|
comments = [comments_0, comments_1]
|
||||||
|
|
||||||
captions_0 = env.params.body["captions_0"]?.try &.as(String) || ""
|
captions_0 = env.params.body["captions_0"]?.try &.as(String) || DEFAULT_USER_PREFERENCES.captions[0]
|
||||||
captions_1 = env.params.body["captions_1"]?.try &.as(String) || ""
|
captions_1 = env.params.body["captions_1"]?.try &.as(String) || DEFAULT_USER_PREFERENCES.captions[1]
|
||||||
captions_2 = env.params.body["captions_2"]?.try &.as(String) || ""
|
captions_2 = env.params.body["captions_2"]?.try &.as(String) || DEFAULT_USER_PREFERENCES.captions[2]
|
||||||
captions = [captions_0, captions_1, captions_2]
|
captions = [captions_0, captions_1, captions_2]
|
||||||
|
|
||||||
related_videos = env.params.body["related_videos"]?.try &.as(String)
|
related_videos = env.params.body["related_videos"]?.try &.as(String)
|
||||||
@ -1154,7 +1154,7 @@ post "/preferences" do |env|
|
|||||||
redirect_feed = redirect_feed == "on"
|
redirect_feed = redirect_feed == "on"
|
||||||
|
|
||||||
locale = env.params.body["locale"]?.try &.as(String)
|
locale = env.params.body["locale"]?.try &.as(String)
|
||||||
locale ||= "en-US"
|
locale ||= DEFAULT_USER_PREFERENCES.locale
|
||||||
|
|
||||||
dark_mode = env.params.body["dark_mode"]?.try &.as(String)
|
dark_mode = env.params.body["dark_mode"]?.try &.as(String)
|
||||||
dark_mode ||= "off"
|
dark_mode ||= "off"
|
||||||
@ -1165,10 +1165,10 @@ post "/preferences" do |env|
|
|||||||
thin_mode = thin_mode == "on"
|
thin_mode = thin_mode == "on"
|
||||||
|
|
||||||
max_results = env.params.body["max_results"]?.try &.as(String).to_i?
|
max_results = env.params.body["max_results"]?.try &.as(String).to_i?
|
||||||
max_results ||= 40
|
max_results ||= DEFAULT_USER_PREFERENCES.max_results
|
||||||
|
|
||||||
sort = env.params.body["sort"]?.try &.as(String)
|
sort = env.params.body["sort"]?.try &.as(String)
|
||||||
sort ||= "published"
|
sort ||= DEFAULT_USER_PREFERENCES.sort
|
||||||
|
|
||||||
latest_only = env.params.body["latest_only"]?.try &.as(String)
|
latest_only = env.params.body["latest_only"]?.try &.as(String)
|
||||||
latest_only ||= "off"
|
latest_only ||= "off"
|
||||||
|
@ -79,36 +79,36 @@ class Preferences
|
|||||||
autoplay: Bool,
|
autoplay: Bool,
|
||||||
continue: {
|
continue: {
|
||||||
type: Bool,
|
type: Bool,
|
||||||
default: false,
|
default: DEFAULT_USER_PREFERENCES.continue,
|
||||||
},
|
},
|
||||||
listen: {
|
listen: {
|
||||||
type: Bool,
|
type: Bool,
|
||||||
default: false,
|
default: DEFAULT_USER_PREFERENCES.listen,
|
||||||
},
|
},
|
||||||
speed: Float32,
|
speed: Float32,
|
||||||
quality: String,
|
quality: String,
|
||||||
volume: Int32,
|
volume: Int32,
|
||||||
comments: {
|
comments: {
|
||||||
type: Array(String),
|
type: Array(String),
|
||||||
default: ["youtube", ""],
|
default: DEFAULT_USER_PREFERENCES.comments,
|
||||||
converter: StringToArray,
|
converter: StringToArray,
|
||||||
},
|
},
|
||||||
captions: {
|
captions: {
|
||||||
type: Array(String),
|
type: Array(String),
|
||||||
default: ["", "", ""],
|
default: DEFAULT_USER_PREFERENCES.captions,
|
||||||
},
|
},
|
||||||
redirect_feed: {
|
redirect_feed: {
|
||||||
type: Bool,
|
type: Bool,
|
||||||
default: false,
|
default: DEFAULT_USER_PREFERENCES.redirect_feed,
|
||||||
},
|
},
|
||||||
related_videos: {
|
related_videos: {
|
||||||
type: Bool,
|
type: Bool,
|
||||||
default: true,
|
default: DEFAULT_USER_PREFERENCES.related_videos,
|
||||||
},
|
},
|
||||||
dark_mode: Bool,
|
dark_mode: Bool,
|
||||||
thin_mode: {
|
thin_mode: {
|
||||||
type: Bool,
|
type: Bool,
|
||||||
default: false,
|
default: DEFAULT_USER_PREFERENCES.thin_mode,
|
||||||
},
|
},
|
||||||
max_results: Int32,
|
max_results: Int32,
|
||||||
sort: String,
|
sort: String,
|
||||||
@ -116,11 +116,11 @@ class Preferences
|
|||||||
unseen_only: Bool,
|
unseen_only: Bool,
|
||||||
notifications_only: {
|
notifications_only: {
|
||||||
type: Bool,
|
type: Bool,
|
||||||
default: false,
|
default: DEFAULT_USER_PREFERENCES.notifications_only,
|
||||||
},
|
},
|
||||||
locale: {
|
locale: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "en-US",
|
default: DEFAULT_USER_PREFERENCES.locale,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
@ -633,6 +633,10 @@ def fetch_video(id, proxies, region)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if info["errorcode"]?.try &.== "2"
|
||||||
|
raise "Video unavailable."
|
||||||
|
end
|
||||||
|
|
||||||
title = info["title"]
|
title = info["title"]
|
||||||
author = info["author"]
|
author = info["author"]
|
||||||
ucid = info["ucid"]
|
ucid = info["ucid"]
|
||||||
@ -741,14 +745,14 @@ def process_video_params(query, preferences)
|
|||||||
volume ||= preferences.volume
|
volume ||= preferences.volume
|
||||||
end
|
end
|
||||||
|
|
||||||
autoplay ||= 0
|
autoplay ||= DEFAULT_USER_PREFERENCES.autoplay.to_unsafe
|
||||||
continue ||= 0
|
continue ||= DEFAULT_USER_PREFERENCES.continue.to_unsafe
|
||||||
listen ||= 0
|
listen ||= DEFAULT_USER_PREFERENCES.listen.to_unsafe
|
||||||
preferred_captions ||= [] of String
|
preferred_captions ||= DEFAULT_USER_PREFERENCES.captions
|
||||||
quality ||= "hd720"
|
quality ||= DEFAULT_USER_PREFERENCES.quality
|
||||||
speed ||= 1
|
speed ||= DEFAULT_USER_PREFERENCES.speed
|
||||||
video_loop ||= 0
|
video_loop ||= DEFAULT_USER_PREFERENCES.video_loop.to_unsafe
|
||||||
volume ||= 100
|
volume ||= DEFAULT_USER_PREFERENCES.volume
|
||||||
|
|
||||||
autoplay = autoplay == 1
|
autoplay = autoplay == 1
|
||||||
continue = continue == 1
|
continue = continue == 1
|
||||||
|
@ -115,38 +115,26 @@ var player = videojs("player", options, function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
player.on('error', function(event) {
|
player.on('error', function(event) {
|
||||||
if (player.error().code === 2) {
|
if (player.error().code === 2 || player.error().code === 4) {
|
||||||
|
setInterval(setTimeout(function (event) {
|
||||||
console.log("An error occured in the player, reloading...");
|
console.log("An error occured in the player, reloading...");
|
||||||
|
|
||||||
var currentTime = player.currentTime();
|
var currentTime = player.currentTime();
|
||||||
var playbackRate = player.playbackRate();
|
var playbackRate = player.playbackRate();
|
||||||
|
var paused = player.paused()
|
||||||
|
|
||||||
player.load();
|
player.load();
|
||||||
if (currentTime > 0.5) {
|
if (currentTime > 0.5) {
|
||||||
currentTime -= 0.5;
|
currentTime -= 0.5;
|
||||||
}
|
}
|
||||||
player.currentTime(currentTime);
|
player.currentTime(currentTime);
|
||||||
player.playbackRate(playbackRate);
|
player.playbackRate(playbackRate);
|
||||||
player.play()
|
|
||||||
} else if (player.error().code === 4) {
|
|
||||||
console.log("Detected invalid source, removing...");
|
|
||||||
var currentTime = player.currentTime();
|
|
||||||
var sources = player.options().sources;
|
|
||||||
|
|
||||||
for (var i = 0; i < sources.length; i++) {
|
if (!paused) {
|
||||||
if (sources[i].src === player.currentSource().src) {
|
|
||||||
sources.splice(i, 1);
|
|
||||||
break
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
player.load();
|
|
||||||
if (currentTime > 0.5) {
|
|
||||||
currentTime -= 0.5;
|
|
||||||
}
|
|
||||||
player.currentTime(currentTime);
|
|
||||||
player.src(sources);
|
|
||||||
player.play();
|
player.play();
|
||||||
}
|
}
|
||||||
|
}, 5000), 5000);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
player.share(shareOptions);
|
player.share(shareOptions);
|
||||||
|
@ -141,7 +141,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% if preferences && preferences.related_videos || plid %>
|
<% if !preferences || preferences && preferences.related_videos || plid %>
|
||||||
<div class="pure-u-1 pure-u-md-1-5">
|
<div class="pure-u-1 pure-u-md-1-5">
|
||||||
<% if plid %>
|
<% if plid %>
|
||||||
<div id="playlist" class="h-box">
|
<div id="playlist" class="h-box">
|
||||||
|
Loading…
Reference in New Issue
Block a user