controller = {
    init: function() {
        document.body.addEventListener("DOMSubtreeModified", sendState);
        return true;
    },
    supports: {
        next:true,
        playpause:true
    },
    play: function() {
        var button = document.querySelector('.player-control-button.player-play-pause');
        fireEvent(button, 'click');
    },
    nextSong: function() {
        var button = document.querySelector('.player-control-button.player-next-episode');
        fireEvent(button, 'click');
    },
    isPlaying: function() {
        var playbutton = document.querySelector('.player-control-button.player-play-pause');
        return playbutton && playbutton.classList.contains('pause');
    },
    getAlbumArt: function() {
        var video = document.querySelector('video'),
            canvas = document.createElement('canvas'),
            ctx;

        if ( ! video || ! video.videoWidth || ! video.videoHeight )
            return null;

        canvas.width = video.videoWidth * .2;
        canvas.height = video.videoHeight * .2;
        ctx = canvas.getContext('2d');
        ctx.drawImage(video, 0, 0, canvas.width, canvas.height);

        return canvas.toDataURL();
    },
    getTitleParts: function() {
        var parts = Array.prototype.slice.call(document.querySelectorAll('.player-status span')),
            main = parts.filter(function(t){return t.classList.contains('player-status-main-title');}).map(function(t){return t.innerText;}),
            sub = parts.filter(function(t){return !t.classList.contains('player-status-main-title');}).map(function(t){return t.innerText;});
        return [main.join(' '),sub.join(' ')];
    },
    getTitle: function() {
        var parts = this.getTitleParts();
        return parts[1] ? parts[1] : parts[0];
    },
    getArtist: function() {
        var parts = this.getTitleParts();
        return parts[1] ? parts[0] : parts[1];
    },
    getState: function() {
        var state = {};
        state.playing = this.isPlaying();
        state.albumArt = this.getAlbumArt();
        state.title = this.getTitle();
        state.artist = this.getArtist();
        return state;
    }
};
@@ -10,136 +10,30 @@
 r = 
-%7B%0A    init: function() %7B%0A        document.body.addEventListener(%22DOMSubtreeModified%22, sendState);%0A        return true;%0A    %7D,%0A  
+new BasicController(%7B%0A
   su
@@ -50,119 +50,65 @@
     
-    next:true,%0A        playpause:
+playpause: true,%0A    next: 
 true
+,
 %0A
-  
   %7D,%0A  
-  
 play
-: function() %7B%0A        var button = document.query
+State
 Selector
 ('.p
@@ -95,33 +95,34 @@
 layStateSelector
-(
+: 
 '.player-control
@@ -151,124 +151,116 @@
 use'
-);%0A        fireEvent(button, 'click');%0A    %7D,%0A    nextSong: function() %7B%0A        var button = document.query
+,%0A  playStateClass: 'pause',%0A  playPauseSelector: '.player-control-button.player-play-pause',%0A  next
 Selector
 ('.p
@@ -247,33 +247,34 @@
 ,%0A  nextSelector
-(
+: 
 '.player-control
@@ -305,129 +305,81 @@
 ode'
-);%0A        fireEvent(button, 'click');%0A    %7D,%0A    isPlaying: function() %7B%0A        var playbutton = document.query
+,%0A  titleSelector: '.player-status %3E span:nth-child(3)',%0A  artist
 Selector
 ('.p
@@ -374,17 +374,18 @@
 Selector
-(
+: 
 '.player
@@ -389,124 +389,54 @@
 yer-
-control-button.player-play-pause');%0A        return playbutton && playbutton.classList.contains('pause');%0A    %7D,%0A    
+status-main-title',%0A%7D);%0A%0Acontroller.override('
 getA
@@ -442,17 +442,18 @@
 AlbumArt
-:
+',
  functio
@@ -454,30 +454,24 @@
 unction() %7B%0A
-      
   var video 
@@ -501,32 +501,24 @@
 r('video'),%0A
-        
     canvas =
@@ -560,28 +560,14 @@
     
-        ctx;%0A%0A      
+ctx;%0A%0A
   if
@@ -624,24 +624,16 @@
 eight )%0A
-        
     retu
@@ -642,22 +642,16 @@
  null;%0A%0A
-      
   canvas
@@ -682,22 +682,16 @@
 h * .2;%0A
-      
   canvas
@@ -724,22 +724,16 @@
 t * .2;%0A
-      
   ctx = 
@@ -757,22 +757,16 @@
 ('2d');%0A
-      
   ctx.dr
@@ -817,22 +817,16 @@
 ight);%0A%0A
-      
   return
@@ -850,974 +850,8 @@
 ();%0A
-    %7D,%0A    getTitleParts: function() %7B%0A        var parts = Array.prototype.slice.call(document.querySelectorAll('.player-status span')),%0A            main = parts.filter(function(t)%7Breturn t.classList.contains('player-status-main-title');%7D).map(function(t)%7Breturn t.innerText;%7D),%0A            sub = parts.filter(function(t)%7Breturn !t.classList.contains('player-status-main-title');%7D).map(function(t)%7Breturn t.innerText;%7D);%0A        return %5Bmain.join(' '),sub.join(' ')%5D;%0A    %7D,%0A    getTitle: function() %7B%0A        var parts = this.getTitleParts();%0A        return parts%5B1%5D ? parts%5B1%5D : parts%5B0%5D;%0A    %7D,%0A    getArtist: function() %7B%0A        var parts = this.getTitleParts();%0A        return parts%5B1%5D ? parts%5B0%5D : parts%5B1%5D;%0A    %7D,%0A    getState: function() %7B%0A        var state = %7B%7D;%0A        state.playing = this.isPlaying();%0A        state.albumArt = this.getAlbumArt();%0A        state.title = this.getTitle();%0A        state.artist = this.getArtist();%0A        return state;%0A    %7D%0A%7D;
+%7D);%0A

Convert Netflix to BasicController