retesere20

recycled-yt-repeated

Jan 27th, 2021
18
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. yt_onload_repeater(){
  3. this.pageSwitchedToRepeater(true);
  4. },
  5.  
  6.  
  7. pageSwitchedToRepeater(additionalCheck){
  8. // this.createInitialPlayer_repeater();
  9. if ( additionalCheck || false ) {
  10. if ( this.currentPage !='repeater') return;
  11. }
  12. if ('vid' in QUERY_PARAMS ) {
  13. this.setYtFieldId_repeater(QUERY_PARAMS['vid']);
  14. this.loadNewVideo_clickEvent_repeater(null);
  15. }
  16. },
  17.  
  18. loadNewVideo_clickEvent_repeater(){
  19. this.createInitialPlayer_repeater();
  20. //this.mainLoad_repeater( this.getYtFieldId_repeater() );
  21. this.setUrl_repeater();
  22. },
  23. mainLoad_repeater(ytId){
  24. //this.ytp2.loadVideoById({'videoId': ytId });
  25. },
  26.  
  27.  
  28. setYtFieldId_repeater(val){
  29. $('#videoField_repeater').val(val);
  30. },
  31. getYtFieldId_repeater(){
  32. var val = $('#videoField_repeater').val().trim();
  33. return PuvoxLibrary.getYtIdFromURL( val );
  34. },
  35. setUrl_repeater(array){
  36. this.output_url_repeater = HOME_URL + '?currentPage=repeater&vid=' + this.getYtFieldId_repeater();
  37. },
  38.  
  39. //CZMuDbaXbC8
  40. createInitialPlayer_repeater(){ if (typeof YT=="undefined") return;
  41. this.ytp2 = new YT.Player(
  42. 'playerDivIDD1_repeater',
  43. {
  44. // enablejsapi : 1,
  45. height: '220', width: this.yt_player_width, videoId: this.getYtFieldId_repeater(),
  46. playerVars: { wmode: 'opaque', autoplay: 1, autohide:0, rel:0, modestbranding:0 },
  47. events: {
  48. 'onReady': this.onReady_func_repeater,
  49. 'onStateChange': this.onStateChange_func_repeater,
  50. },
  51. host: 'https://www.youtube.com',
  52. //origin:window.location.host
  53. }
  54. );
  55. return this.ytp2;
  56. },
  57.  
  58. onReady_func_repeater(event) {
  59.  
  60. },
  61. // player.getPlayerState() event.data: -1 unstarted; 0 ended; 1 playing; 2 paused; 3 buffering; 5 video cued
  62. onStateChange_func_repeater(event) {
  63. if(event.data==-1){
  64. }
  65. if(event.data==+1){
  66. }
  67. if(event.data==0){
  68. this.ytp2.seekTo(0);
  69. this.ytp2.playVideo(0);
  70. }
  71. },
RAW Paste Data