From baf0982515013f80f3de61b777a9781ee70d9982 Mon Sep 17 00:00:00 2001 From: Calvin Correli Date: Fri, 5 Jan 2018 15:29:34 -0500 Subject: [PATCH] fix: silence unhandled promise rejection in Safari when seeking (#4860) Fix #4853. --- package-lock.json | 35 +++++++++++++++---- .../control-bar/progress-control/seek-bar.js | 3 +- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3cd40ede4..9b4f77c20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10765,13 +10765,26 @@ } }, "remark-toc": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/remark-toc/-/remark-toc-4.0.1.tgz", - "integrity": "sha1-/zb/beVOoH3Vnj9TNKSjqsHpMYU=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/remark-toc/-/remark-toc-5.0.0.tgz", + "integrity": "sha512-j2A/fpio1nzNRJtY6nVaFUCtXNfFPxaj6I5UHFsFgo4xKmc0VokRRIzGqz4Vfs7u+dPrHjnoHkImu1Dia0jDSQ==", "dev": true, "requires": { "mdast-util-toc": "2.0.1", - "remark-slug": "4.2.3" + "remark-slug": "5.0.0" + }, + "dependencies": { + "remark-slug": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/remark-slug/-/remark-slug-5.0.0.tgz", + "integrity": "sha512-bRFK90ia6iooqC5KH6e9nEIL3OwRbTPU6ed2fm/fa66uofKdmRcsmRVMwND3pXLbvH2F022cETYlE7YlVs7LNQ==", + "dev": true, + "requires": { + "github-slugger": "1.2.0", + "mdast-util-to-string": "1.0.4", + "unist-util-visit": "1.1.3" + } + } } }, "remark-validate-links": { @@ -13048,6 +13061,14 @@ "videojs-ie8": "1.1.2", "videojs-vtt.js": "0.12.4", "xhr": "2.4.0" + }, + "dependencies": { + "videojs-font": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/videojs-font/-/videojs-font-2.0.0.tgz", + "integrity": "sha1-r3Rh751LleAzS/+3iy8v8DZKkDQ=", + "dev": true + } } }, "videojs-flash": { @@ -13062,9 +13083,9 @@ } }, "videojs-font": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/videojs-font/-/videojs-font-2.0.0.tgz", - "integrity": "sha1-r3Rh751LleAzS/+3iy8v8DZKkDQ=" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/videojs-font/-/videojs-font-2.1.0.tgz", + "integrity": "sha1-olkwpn9snPvyu4jay4xrRR8JM3k=" }, "videojs-ie8": { "version": "1.1.2", diff --git a/src/js/control-bar/progress-control/seek-bar.js b/src/js/control-bar/progress-control/seek-bar.js index 674a86c43..16c0fd298 100644 --- a/src/js/control-bar/progress-control/seek-bar.js +++ b/src/js/control-bar/progress-control/seek-bar.js @@ -7,6 +7,7 @@ import {IE_VERSION, IS_IOS, IS_ANDROID} from '../../utils/browser.js'; import * as Dom from '../../utils/dom.js'; import * as Fn from '../../utils/fn.js'; import formatTime from '../../utils/format-time.js'; +import {silencePromise} from '../../utils/promise'; import './load-progress-bar.js'; import './play-progress-bar.js'; @@ -254,7 +255,7 @@ class SeekBar extends Slider { */ this.player_.trigger({ type: 'timeupdate', target: this, manuallyTriggered: true }); if (this.videoWasPlaying) { - this.player_.play(); + silencePromise(this.player_.play()); } }