Skip to content

Commit

Permalink
Fix invalid src when iframe.params is empty (close #35)
Browse files Browse the repository at this point in the history
  • Loading branch information
orestbida committed Feb 7, 2023
1 parent afe33c2 commit 2e11b28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/iframemanager.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/iframemanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
/**
* @type {string}
*/
const iframeParams = video._params || service?.iframe.params;
const iframeParams = video._params || service?.iframe?.params;

// Replace data-id with valid resource id
const embedUrl = service.embedUrl || '';
Expand All @@ -340,7 +340,7 @@
video._title && (video._iframe.title = video._title);

// Add parameters to src
if(isString(iframeParams)){
if(iframeParams && isString(iframeParams)){
src += iframeParams.slice(0, 1) === '?'
? iframeParams
: `?${iframeParams}`
Expand Down

0 comments on commit 2e11b28

Please sign in to comment.