File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,14 @@ export default (emitter: EmitterType): Promise<IframeApiType> => {
1616 resolve ( window . YT ) ;
1717
1818 return ;
19+ } else {
20+ const protocol = window . location . protocol === 'http:' ? 'http:' : 'https:' ;
21+
22+ load ( protocol + '//www.youtube.com/iframe_api' , ( error ) => {
23+ if ( error ) {
24+ emitter . trigger ( 'error' , error ) ;
25+ }
26+ } ) ;
1927 }
2028
2129 const previous = window . onYouTubeIframeAPIReady ;
@@ -31,13 +39,5 @@ export default (emitter: EmitterType): Promise<IframeApiType> => {
3139 } ;
3240 } ) ;
3341
34- const protocol = window . location . protocol === 'http:' ? 'http:' : 'https:' ;
35-
36- load ( protocol + '//www.youtube.com/iframe_api' , ( error ) => {
37- if ( error ) {
38- emitter . trigger ( 'error' , error ) ;
39- }
40- } ) ;
41-
4242 return iframeAPIReady ;
4343} ;
You can’t perform that action at this time.
0 commit comments