Skip to content

Commit

Permalink
always execute display area update function on window resize
Browse files Browse the repository at this point in the history
and remember to remove the event listener on dispose.

Resolves #18
  • Loading branch information
SunnyLi committed Jan 9, 2017
1 parent cbaf2cd commit b8064f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "videojs-ass",
"version": "0.6.2",
"version": "0.6.3",
"author": "Sunny Li",
"description": "ASS/SSA subtitle overlay for videojs",
"repository": {
Expand Down
4 changes: 1 addition & 3 deletions src/videojs.ass.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,14 @@
}, 100);
}

if (player.fluid()) {
window.addEventListener('resize', updateDisplayArea);
}

player.on('loadedmetadata', updateDisplayArea);
player.on('resize', updateDisplayArea);
player.on('fullscreenchange', updateDisplayArea);

player.on('dispose', function () {
clock.disable();
window.removeEventListener('resize', updateDisplayArea);
});

libjass.ASS.fromUrl(options.src, libjass.Format.ASS).then(
Expand Down

0 comments on commit b8064f6

Please sign in to comment.