src/js/pop.js
author hamidouk
Thu, 08 Dec 2011 15:52:01 +0100
branchpopcorn-port
changeset 441 99b7c5192330
parent 431 f9460dc1957f
child 442 ee6594f6d00d
permissions -rw-r--r--
fixed horrible bug involving jQuery message passing.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
387
d1fe53ad8d72 initial commit
hamidouk
parents:
diff changeset
     1
/* wrapper that simulates popcorn.js because
d1fe53ad8d72 initial commit
hamidouk
parents:
diff changeset
     2
   popcorn is a bit unstable at the time */
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
     3
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
     4
IriSP.PopcornReplacement = {};
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
     5
IriSP.PopcornReplacement.media = { "paused": true};
390
9b4e5f606d72 first draft, a little rough around the edges.
hamidouk
parents: 388
diff changeset
     6
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
     7
IriSP.PopcornReplacement.listen = function(msg, callback) {
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
     8
  IriSP.jQuery(IriSP.PopcornReplacement).bind(msg, function(event, rest) { callback(rest); });
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
     9
};
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    10
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    11
IriSP.PopcornReplacement.trigger = function(msg, params) {
441
99b7c5192330 fixed horrible bug involving jQuery message passing.
hamidouk
parents: 431
diff changeset
    12
  IriSP.jQuery(IriSP.PopcornReplacement).triggerHandler(msg, params);
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    13
};
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    14
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    15
IriSP.PopcornReplacement.guid = function(prefix) {
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    16
  var str = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    17
      var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    18
      return v.toString(16);
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    19
   });
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    20
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    21
  return prefix + str;
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    22
};
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    23
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    24
IriSP.PopcornReplacement.__initApi = function() {
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    25
  IriSP.PopcornReplacement.trigger("timeupdate");
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    26
};
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    27
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    28
IriSP.PopcornReplacement.jwplayer = function(container, options) {
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    29
  IriSP.PopcornReplacement._container = container.slice(1); //eschew the '#'
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    30
  options.events = {
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    31
      onReady: IriSP.PopcornReplacement.__initApi,
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    32
      onTime: IriSP.PopcornReplacement.__timeHandler,
441
99b7c5192330 fixed horrible bug involving jQuery message passing.
hamidouk
parents: 431
diff changeset
    33
  //    onPlay: IriSP.PopcornReplacement.__playHandler,
99b7c5192330 fixed horrible bug involving jQuery message passing.
hamidouk
parents: 431
diff changeset
    34
  //    onPause: IriSP.PopcornReplacement.__pauseHandler,
99b7c5192330 fixed horrible bug involving jQuery message passing.
hamidouk
parents: 431
diff changeset
    35
      onSeek: IriSP.PopcornReplacement.__seekHandler 
99b7c5192330 fixed horrible bug involving jQuery message passing.
hamidouk
parents: 431
diff changeset
    36
      }
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    37
    
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    38
  jwplayer(IriSP.PopcornReplacement._container).setup(options);
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    39
  IriSP.PopcornReplacement.media.duration = options.duration;
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    40
  return IriSP.PopcornReplacement;
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    41
};
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    42
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    43
IriSP.PopcornReplacement.currentTime = function(time) {
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    44
  if (typeof(time) === "undefined") {
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    45
      return jwplayer(IriSP.PopcornReplacement._container).getPosition();            
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    46
  } else {
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    47
     var currentTime = +time;
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    48
     jwplayer( IriSP.PopcornReplacement._container ).seek( currentTime );
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    49
     return jwplayer(IriSP.PopcornReplacement._container).getPosition();            
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    50
  }
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    51
};
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    52
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    53
IriSP.PopcornReplacement.play = function() {
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    54
      IriSP.PopcornReplacement.media.paused = false;
441
99b7c5192330 fixed horrible bug involving jQuery message passing.
hamidouk
parents: 431
diff changeset
    55
      IriSP.PopcornReplacement.trigger("play");
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    56
//      IriSP.PopcornReplacement.trigger("playing");
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    57
      jwplayer( IriSP.PopcornReplacement._container ).play();
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    58
};
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    59
    
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    60
IriSP.PopcornReplacement.pause = function() {
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    61
      if ( !IriSP.PopcornReplacement.media.paused ) {
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    62
        IriSP.PopcornReplacement.media.paused = true;
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    63
        IriSP.PopcornReplacement.trigger( "pause" );
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    64
        jwplayer( IriSP.PopcornReplacement._container ).pause();
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    65
      }
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    66
};
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    67
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    68
IriSP.PopcornReplacement.muted = function(val) {
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    69
  if (typeof(val) !== "undefined") {
390
9b4e5f606d72 first draft, a little rough around the edges.
hamidouk
parents: 388
diff changeset
    70
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    71
    if (jwplayer(IriSP.PopcornReplacement._container).getMute() !== val) {
390
9b4e5f606d72 first draft, a little rough around the edges.
hamidouk
parents: 388
diff changeset
    72
      if (val) {
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    73
        jwplayer(IriSP.PopcornReplacement._container).setMute(true);
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    74
      } else {
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    75
        jwplayer( IriSP.PopcornReplacement._container ).setMute(false);
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    76
      }
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    77
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    78
      IriSP.PopcornReplacement.trigger( "volumechange" );
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    79
    }
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    80
    
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    81
    return jwplayer( IriSP.PopcornReplacement._container ).getMute();
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    82
  } else {
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    83
    return jwplayer( IriSP.PopcornReplacement._container ).getMute();
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
    84
  }
390
9b4e5f606d72 first draft, a little rough around the edges.
hamidouk
parents: 388
diff changeset
    85
};
9b4e5f606d72 first draft, a little rough around the edges.
hamidouk
parents: 388
diff changeset
    86
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    87
IriSP.PopcornReplacement.mute = IriSP.PopcornReplacement.muted;
394
89a79a2c6014 WIP - working on the code function.
hamidouk
parents: 391
diff changeset
    88
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    89
IriSP.PopcornReplacement.__codes = [];
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    90
IriSP.PopcornReplacement.code = function(options) {
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    91
  IriSP.PopcornReplacement.__codes.push(options);
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    92
  return IriSP.PopcornReplacement;
390
9b4e5f606d72 first draft, a little rough around the edges.
hamidouk
parents: 388
diff changeset
    93
};
9b4e5f606d72 first draft, a little rough around the edges.
hamidouk
parents: 388
diff changeset
    94
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    95
IriSP.PopcornReplacement.__runCode = function() {
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    96
  var currentTime = jwplayer(IriSP.PopcornReplacement._container).getPosition();
390
9b4e5f606d72 first draft, a little rough around the edges.
hamidouk
parents: 388
diff changeset
    97
  var i = 0;
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    98
  for(i = 0; i < IriSP.PopcornReplacement.__codes.length; i++) {
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
    99
    var c = IriSP.PopcornReplacement.__codes[i];
391
0a68395f7e12 added duration. automatically trigger timeupdate.
hamidouk
parents: 390
diff changeset
   100
    if (currentTime == c.start) {
390
9b4e5f606d72 first draft, a little rough around the edges.
hamidouk
parents: 388
diff changeset
   101
      c.onStart();
9b4e5f606d72 first draft, a little rough around the edges.
hamidouk
parents: 388
diff changeset
   102
    }
9b4e5f606d72 first draft, a little rough around the edges.
hamidouk
parents: 388
diff changeset
   103
    
391
0a68395f7e12 added duration. automatically trigger timeupdate.
hamidouk
parents: 390
diff changeset
   104
    if (currentTime == c.end) {
390
9b4e5f606d72 first draft, a little rough around the edges.
hamidouk
parents: 388
diff changeset
   105
      c.onEnd();
9b4e5f606d72 first draft, a little rough around the edges.
hamidouk
parents: 388
diff changeset
   106
    }
388
30277c1e3d46 replaced most of popcorn's functions.
hamidouk
parents: 387
diff changeset
   107
390
9b4e5f606d72 first draft, a little rough around the edges.
hamidouk
parents: 388
diff changeset
   108
  }
394
89a79a2c6014 WIP - working on the code function.
hamidouk
parents: 391
diff changeset
   109
};
391
0a68395f7e12 added duration. automatically trigger timeupdate.
hamidouk
parents: 390
diff changeset
   110
394
89a79a2c6014 WIP - working on the code function.
hamidouk
parents: 391
diff changeset
   111
/* called everytime the player updates itself 
89a79a2c6014 WIP - working on the code function.
hamidouk
parents: 391
diff changeset
   112
   (onTime event)
89a79a2c6014 WIP - working on the code function.
hamidouk
parents: 391
diff changeset
   113
 */
89a79a2c6014 WIP - working on the code function.
hamidouk
parents: 391
diff changeset
   114
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
   115
IriSP.PopcornReplacement.__timeHandler = function(event) {
417
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   116
  var pos = event.position;
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   117
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   118
  var i = 0;
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
   119
  for(i = 0; i < IriSP.PopcornReplacement.__codes.length; i++) {
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
   120
     var c = IriSP.PopcornReplacement.__codes[i];
417
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   121
     
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   122
     if (pos >= c.start && pos < c.end && 
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   123
         pos - 0.1 <= c.start) {
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   124
        c.onStart();
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   125
     }
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   126
 
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   127
     if (pos >= c.start && pos >= c.end && 
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   128
         pos - 0.1 <= c.end) {
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   129
        c.onEnd();
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   130
     }
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   131
   
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   132
  }
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   133
 
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
   134
  IriSP.PopcornReplacement.trigger("timeupdate");
390
9b4e5f606d72 first draft, a little rough around the edges.
hamidouk
parents: 388
diff changeset
   135
};
394
89a79a2c6014 WIP - working on the code function.
hamidouk
parents: 391
diff changeset
   136
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
   137
IriSP.PopcornReplacement.__seekHandler = function(event) { 
417
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   138
  var i = 0;
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
   139
  for(i = 0; i < IriSP.PopcornReplacement.__codes.length; i++) {
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
   140
     var c = IriSP.PopcornReplacement.__codes[i];
417
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   141
    
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   142
     if (event.position >= c.start && event.position < c.end) {
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   143
        c.onEnd();
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   144
     }
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   145
    
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   146
     if (typeof(event.offset) === "undefined")
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   147
       event.offset = 0;
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   148
     if (event.offset >= c.start && event.offset < c.end) {
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   149
       c.onStart();
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   150
     }
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   151
     
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   152
   }
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   153
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
   154
  IriSP.PopcornReplacement.trigger("timeupdate");
441
99b7c5192330 fixed horrible bug involving jQuery message passing.
hamidouk
parents: 431
diff changeset
   155
};
99b7c5192330 fixed horrible bug involving jQuery message passing.
hamidouk
parents: 431
diff changeset
   156
417
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   157
441
99b7c5192330 fixed horrible bug involving jQuery message passing.
hamidouk
parents: 431
diff changeset
   158
IriSP.PopcornReplacement.__playHandler = function(event) {
99b7c5192330 fixed horrible bug involving jQuery message passing.
hamidouk
parents: 431
diff changeset
   159
  IriSP.PopcornReplacement.media.paused = false;
99b7c5192330 fixed horrible bug involving jQuery message passing.
hamidouk
parents: 431
diff changeset
   160
};
99b7c5192330 fixed horrible bug involving jQuery message passing.
hamidouk
parents: 431
diff changeset
   161
99b7c5192330 fixed horrible bug involving jQuery message passing.
hamidouk
parents: 431
diff changeset
   162
IriSP.PopcornReplacement.__pauseHandler = function(event) {
99b7c5192330 fixed horrible bug involving jQuery message passing.
hamidouk
parents: 431
diff changeset
   163
  IriSP.PopcornReplacement.media.paused = true;
99b7c5192330 fixed horrible bug involving jQuery message passing.
hamidouk
parents: 431
diff changeset
   164
};
417
bae7c50704d7 fixed code() function. The Popcorn workaround now works correctly.
hamidouk
parents: 394
diff changeset
   165
431
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
   166
IriSP.PopcornReplacement.roundTime = function() {
f9460dc1957f made our jwplayer wrapper a subobject of IriSP.
hamidouk
parents: 419
diff changeset
   167
  var currentTime = IriSP.PopcornReplacement.currentTime();
394
89a79a2c6014 WIP - working on the code function.
hamidouk
parents: 391
diff changeset
   168
  return Math.round(currentTime);
89a79a2c6014 WIP - working on the code function.
hamidouk
parents: 391
diff changeset
   169
};