Skip to content

Commit

Permalink
trim input whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
eyaler committed Oct 5, 2024
1 parent 74774c4 commit c13b1df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/videoloader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default function load_video(input, video_elem) {
input = input.value ?? input
input = (input.value ?? input).trim()
let [vid_id, params, hash_params] = [...input.split(/(?:[?&]|(?=#))([^#]*)/), '', '']
if (vid_id.includes('=')) {
if (params)
Expand Down Expand Up @@ -51,7 +51,7 @@ export default function load_video(input, video_elem) {
}
else if (host && !host.includes('youtu')) { // Any non YouTube / Vimeo URL
url = input
hash = input.match(/(.*?https:\/\/)?(.*)/).at(-1)
hash = input.match(/(https:\/\/)?(.*)/).at(-1)
} else if (input) { // YouTube
let playlist_params = '&playlist=' + vid_id
if (params.size) {
Expand Down

0 comments on commit c13b1df

Please sign in to comment.