@@ -1272,14 +1272,14 @@ var loadYT = function(vid, plist, lid, ta, tb, r, lType = "playlist") {
12721272 myResizable . appendChild ( ytDiv ) ;
12731273 //create new YT player iframe, replacing ytDiv
12741274 ytPlayer = new YT . Player ( "ytDiv" , {
1275- videoId : vid && vid . substring ( 0 , 4 ) === "vid:" ? vid . substring ( 4 ) : vid ,
1275+ videoId : vid && vid . substring ( 0 , 4 ) === "vid:" ? vid . substring ( 4 ) : "" ,
12761276 width : playerWidth ,
12771277 height : $ ( "#myResizable" ) . height ( ) ,
12781278 playerVars : {
1279- index : vid && vid . substring ( 0 , 4 ) === "idx:" ? vid . substring ( 4 ) : null ,
1280- list : lid ,
1281- listType : lType ,
1282- playlist : plist ,
1279+ index : vid && vid . substring ( 0 , 4 ) === "idx:" ? vid . substring ( 4 ) : "" ,
1280+ list : lid ? lid : "" ,
1281+ listType : lType ? lType : "" ,
1282+ playlist : plist ? plist : "" ,
12831283 //loop: 1, //loop over playlist
12841284 //playlist: vid && !plist && !lid ? vid.substring(4) : plist, //loop single video
12851285 autoplay : 1 ,
@@ -1316,8 +1316,9 @@ var loadYT = function(vid, plist, lid, ta, tb, r, lType = "playlist") {
13161316 "onError" : function ( e ) {
13171317 console . log ( "Error: " + e . data ) ;
13181318 resetUI ( ) ;
1319- if ( lid && lType === "playlist" ) loadYT ( vid , null , lid , ta , tb , r , "user_uploads" ) ;
1320- else loadYT ( null , null , null , null , null , null ) ;
1319+ if ( lid && lType === "playlist" ) { // instead, try with "user_uploads" as list type
1320+ loadYT ( vid , null , lid , ta , tb , r , "user_uploads" ) ;
1321+ }
13211322 }
13221323 }
13231324 } ) ;
@@ -1798,4 +1799,4 @@ var initVT = function() { // <video> tag
17981799 isPlaying = function ( ) {
17991800 return ! myVideo . paused && ! myVideo . ended ;
18001801 }
1801- }
1802+ }
0 commit comments