File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545 return {
4646 extractSingleVideoIdOrUserID : function ( url ) {
4747 var match = url . match ( / ( \. c o m ) \/ ( .+ ) / ) ;
48+
49+ if ( match [ 2 ] . split ( "/" ) [ 1 ] ) {
50+ match [ 2 ] = match [ 2 ] . split ( "/" ) [ 0 ] + ":" + match [ 2 ] . split ( "/" ) [ 1 ]
51+ }
4852 var rgx = / \/ .+ \/ ? / g;
4953
5054 if ( match && ! rgx . test ( match [ 2 ] ) ) {
55+ // normal single videos : should send only the video id
5156 return match [ 2 ] . split ( "/" ) [ 0 ] ;
57+ } else if ( match && rgx . test ( match [ 2 ] ) ) {
58+ // this part for unlisted videos >> it should be sent like this "videoId:privacyHash">> sample: "528104478:257ef1e75a"
59+ return match [ 2 ] . split ( "/" ) [ 0 ] + ":" + match [ 2 ] . split ( "/" ) [ 1 ] ;
5260 } else {
5361 return null ;
5462 }
55-
5663 } ,
5764 extractFeedID : function ( url ) {
5865 var match = url . match ( / ( c h a n n e l s ) \/ ( .+ ) / ) ;
Original file line number Diff line number Diff line change 8181 . filter ( 'returnVimeoUrl' , [ '$sce' , function ( $sce ) {
8282 return function ( uri ) {
8383 var id = uri . split ( "/" ) . pop ( ) ;
84+
85+ // this part for unlisted videos >> sample: https://player.vimeo.com/video/528104478/257ef1e75a
86+ // it should be sent like this > https://player.vimeo.com/video/528104478?h=257ef1e75a
87+ if ( id . split ( ":" ) [ 1 ] ) {
88+ id = id . split ( ":" ) [ 0 ] + "?h=" + id . split ( ":" ) [ 1 ]
89+ }
90+
8491 if ( id . includes ( ':' ) )
8592 id = id . substr ( 0 , id . indexOf ( ':' ) ) ;
8693 return $sce . trustAsResourceUrl ( "https://player.vimeo.com/video/" + id ) ;
You can’t perform that action at this time.
0 commit comments