pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

pastebin - collaborative debugging tool View Help


Posted by Anonymous on Sat 14 Jun 15:45
report abuse | download | new post

  1. // ==UserScript==
  2. // @name           mplaytube
  3. // @namespace      http://untitledfinale.wordpress.com
  4. // @description    play youtube videos with mplayer
  5. // @include        www.youtube.com/*
  6. // ==/UserScript==
  7.  
  8. // YouTube URL: http://www.youtube.com/watch?v=[video_id]
  9. // YouTube download link: http://youtube.com/get_video?video_id=[video_id]&t=[t_id]
  10.  
  11. var download_url = 'http://youtube.com/get_video?video_id=';
  12.  
  13. /*var checker = document.getElementById('watch-checker-div');
  14. if(checker){
  15.    checker.parentNode.removeChild(checker);
  16. }*/
  17.  
  18. var player = document.getElementById('watch-player-div');
  19. var i = player.innerHTML;
  20. var t_id = i.match(/t=([^(\&|$)]*)/)[1];
  21. var video_id = i.match(/video_id=([^(\&|$)]*)/)[1];
  22. var video_url = download_url + video_id + '&t=' + t_id;
  23. var player2 = document.getElementById('movie_player');
  24. player.innerHTML = '<embed type="application/x-mplayer2" src="'+ video_url +'" width="'+player2.width+'" height="'+player2.height+'">';

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me so that I can delete my post