@breakside/jskit 2024.5.0 → 2024.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/Frameworks/DOM.jsframework/Info.json +2 -2
  2. package/Frameworks/DOM.jsframework/io.breakside.JSKit.DOM-bundle.js +2 -2
  3. package/Frameworks/FontKit.jsframework/Info.json +2 -2
  4. package/Frameworks/FontKit.jsframework/io.breakside.JSKit.FontKit-bundle.js +2 -2
  5. package/Frameworks/Foundation.jsframework/Info.json +2 -2
  6. package/Frameworks/Foundation.jsframework/JS/JSSynchronizer.js +19 -0
  7. package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
  8. package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
  9. package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
  10. package/Info.json +2 -2
  11. package/Node/io.breakside.jskit-bundle.js +2 -2
  12. package/Root/Frameworks/APIKit/Info.yaml +1 -1
  13. package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
  14. package/Root/Frameworks/AuthKit/Info.yaml +1 -1
  15. package/Root/Frameworks/CSSOM/Info.yaml +1 -1
  16. package/Root/Frameworks/ChartKit/Info.yaml +1 -1
  17. package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
  18. package/Root/Frameworks/DBKit/Info.yaml +1 -1
  19. package/Root/Frameworks/DOM/Info.yaml +1 -1
  20. package/Root/Frameworks/Dispatch/Info.yaml +1 -1
  21. package/Root/Frameworks/FontKit/Info.yaml +1 -1
  22. package/Root/Frameworks/Foundation/Info.yaml +1 -1
  23. package/Root/Frameworks/Foundation/JSSynchronizer.js +19 -0
  24. package/Root/Frameworks/ImageKit/Info.yaml +1 -1
  25. package/Root/Frameworks/MediaKit/Info.yaml +1 -1
  26. package/Root/Frameworks/MediaKit/MKAsset+HTML.js +38 -9
  27. package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
  28. package/Root/Frameworks/MediaKitUI/MKVideoView+HTML.js +1 -0
  29. package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
  30. package/Root/Frameworks/NotificationKit/NKHTMLUserNotificationCenter.js +5 -5
  31. package/Root/Frameworks/PDFKit/Info.yaml +1 -1
  32. package/Root/Frameworks/QRKit/Info.yaml +1 -1
  33. package/Root/Frameworks/SearchKit/Info.yaml +1 -1
  34. package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
  35. package/Root/Frameworks/ServerKit/Info.yaml +1 -1
  36. package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
  37. package/Root/Frameworks/TestKit/Info.yaml +1 -1
  38. package/Root/Frameworks/UIKit/Info.yaml +1 -1
  39. package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
  40. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.DOM",
4
- "JSBundleVersion": "2024.5.0",
4
+ "JSBundleVersion": "2024.6.0",
5
5
  "JSDevelopmentLanguage": "en",
6
6
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
7
7
  "JSBundleEnvironments": {
@@ -9,5 +9,5 @@
9
9
  "node": "DOM+Node.js"
10
10
  },
11
11
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
12
- "GitRevision": "27bc44a0baba9849d46ec9d6cb00a43dd302acf9"
12
+ "GitRevision": "3aecdc11b14a3dbba2028fb148aa9affeb3663b7"
13
13
  }
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "framework",
5
5
  "JSBundleIdentifier": "io.breakside.JSKit.DOM",
6
- "JSBundleVersion": "2024.5.0",
6
+ "JSBundleVersion": "2024.6.0",
7
7
  "JSDevelopmentLanguage": "en",
8
8
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
9
9
  "JSBundleEnvironments": {
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
11
11
  "node": "DOM+Node.js"
12
12
  },
13
13
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
14
- "GitRevision": "27bc44a0baba9849d46ec9d6cb00a43dd302acf9"
14
+ "GitRevision": "3aecdc11b14a3dbba2028fb148aa9affeb3663b7"
15
15
  },
16
16
  "Resources": [],
17
17
  "ResourceLookup": {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.FontKit",
4
- "JSBundleVersion": "2024.5.0",
4
+ "JSBundleVersion": "2024.6.0",
5
5
  "JSDevelopmentLanguage": "en",
6
6
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
7
7
  "JSBundleEnvironments": {
8
8
  "html": "FontKit+HTML.js"
9
9
  },
10
10
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
11
- "GitRevision": "27bc44a0baba9849d46ec9d6cb00a43dd302acf9"
11
+ "GitRevision": "3aecdc11b14a3dbba2028fb148aa9affeb3663b7"
12
12
  }
@@ -3,14 +3,14 @@ JSBundle.bundles['io.breakside.JSKit.FontKit'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "framework",
5
5
  "JSBundleIdentifier": "io.breakside.JSKit.FontKit",
6
- "JSBundleVersion": "2024.5.0",
6
+ "JSBundleVersion": "2024.6.0",
7
7
  "JSDevelopmentLanguage": "en",
8
8
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
9
9
  "JSBundleEnvironments": {
10
10
  "html": "FontKit+HTML.js"
11
11
  },
12
12
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
13
- "GitRevision": "27bc44a0baba9849d46ec9d6cb00a43dd302acf9"
13
+ "GitRevision": "3aecdc11b14a3dbba2028fb148aa9affeb3663b7"
14
14
  },
15
15
  "Resources": [],
16
16
  "ResourceLookup": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.Foundation",
4
- "JSBundleVersion": "2024.5.0",
4
+ "JSBundleVersion": "2024.6.0",
5
5
  "JSDevelopmentLanguage": "en",
6
6
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
7
7
  "JSBundleEnvironments": {
@@ -9,5 +9,5 @@
9
9
  "node": "Foundation+Node.js"
10
10
  },
11
11
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
12
- "GitRevision": "27bc44a0baba9849d46ec9d6cb00a43dd302acf9"
12
+ "GitRevision": "3aecdc11b14a3dbba2028fb148aa9affeb3663b7"
13
13
  }
@@ -45,6 +45,21 @@ JSClass("JSSynchronizer", JSObject, {
45
45
  return this._scheduleSync(0, completion, target);
46
46
  },
47
47
 
48
+ _isPaused: false,
49
+ _syncOnResume: false,
50
+
51
+ pause: function(){
52
+ this._isPaused = true;
53
+ },
54
+
55
+ resume: function(){
56
+ this._isPaused = false;
57
+ if (this._syncOnResume){
58
+ this._syncOnResume = true;
59
+ this._scheduleSync(0, function(){});
60
+ }
61
+ },
62
+
48
63
  cancel: function(){
49
64
  if (this._pendingTimer !== null){
50
65
  this._pendingTimer.invalidate();
@@ -76,6 +91,10 @@ JSClass("JSSynchronizer", JSObject, {
76
91
  },
77
92
 
78
93
  _sync: function(){
94
+ if (this._isPaused){
95
+ this._syncOnResume = true;
96
+ return;
97
+ }
79
98
  this._pendingTimer = null;
80
99
  var controller = this;
81
100
  var started = false;
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.Foundation'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "framework",
5
5
  "JSBundleIdentifier": "io.breakside.JSKit.Foundation",
6
- "JSBundleVersion": "2024.5.0",
6
+ "JSBundleVersion": "2024.6.0",
7
7
  "JSDevelopmentLanguage": "en",
8
8
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
9
9
  "JSBundleEnvironments": {
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.Foundation'] = {
11
11
  "node": "Foundation+Node.js"
12
12
  },
13
13
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
14
- "GitRevision": "27bc44a0baba9849d46ec9d6cb00a43dd302acf9"
14
+ "GitRevision": "3aecdc11b14a3dbba2028fb148aa9affeb3663b7"
15
15
  },
16
16
  "Resources": [
17
17
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.SecurityKit",
4
- "JSBundleVersion": "2024.5.0",
4
+ "JSBundleVersion": "2024.6.0",
5
5
  "JSDevelopmentLanguage": "en",
6
6
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
7
7
  "JSBundleEnvironments": {
@@ -9,5 +9,5 @@
9
9
  "node": "SecurityKit+Node.js"
10
10
  },
11
11
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
12
- "GitRevision": "27bc44a0baba9849d46ec9d6cb00a43dd302acf9"
12
+ "GitRevision": "3aecdc11b14a3dbba2028fb148aa9affeb3663b7"
13
13
  }
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.SecurityKit'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "framework",
5
5
  "JSBundleIdentifier": "io.breakside.JSKit.SecurityKit",
6
- "JSBundleVersion": "2024.5.0",
6
+ "JSBundleVersion": "2024.6.0",
7
7
  "JSDevelopmentLanguage": "en",
8
8
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
9
9
  "JSBundleEnvironments": {
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.SecurityKit'] = {
11
11
  "node": "SecurityKit+Node.js"
12
12
  },
13
13
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
14
- "GitRevision": "27bc44a0baba9849d46ec9d6cb00a43dd302acf9"
14
+ "GitRevision": "3aecdc11b14a3dbba2028fb148aa9affeb3663b7"
15
15
  },
16
16
  "Resources": [],
17
17
  "ResourceLookup": {
package/Info.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "JSBundleType": "node",
3
3
  "JSBundleIdentifier": "io.breakside.jskit",
4
- "JSBundleVersion": "2024.5.0",
4
+ "JSBundleVersion": "2024.6.0",
5
5
  "JSExecutableName": "jskit",
6
6
  "NPMOrganization": "breakside",
7
7
  "JSResources": [
8
8
  "Tests/HTMLTestRunner.js",
9
9
  "Tests/NodeTestRunner.js"
10
10
  ],
11
- "GitRevision": "27bc44a0baba9849d46ec9d6cb00a43dd302acf9"
11
+ "GitRevision": "3aecdc11b14a3dbba2028fb148aa9affeb3663b7"
12
12
  }
@@ -3,14 +3,14 @@ JSBundle.bundles['io.breakside.jskit'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "node",
5
5
  "JSBundleIdentifier": "io.breakside.jskit",
6
- "JSBundleVersion": "2024.5.0",
6
+ "JSBundleVersion": "2024.6.0",
7
7
  "JSExecutableName": "jskit",
8
8
  "NPMOrganization": "breakside",
9
9
  "JSResources": [
10
10
  "Tests/HTMLTestRunner.js",
11
11
  "Tests/NodeTestRunner.js"
12
12
  ],
13
- "GitRevision": "27bc44a0baba9849d46ec9d6cb00a43dd302acf9"
13
+ "GitRevision": "3aecdc11b14a3dbba2028fb148aa9affeb3663b7"
14
14
  },
15
15
  "Resources": [
16
16
  {
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.APIKit
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSIncludeDirectories:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.APIKitTesting
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.AuthKit
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.CSSOM
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ChartKit
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2021 Breakside Inc.
6
6
  # JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ConferenceKit
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.DBKit
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.DOM
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.Dispatch
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSCopyright: Copyright © 2020 Breakside Inc.
5
5
  JSBundleEnvironments:
6
6
  html: Dispatch+HTML.js
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.FontKit
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.Foundation
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -45,6 +45,21 @@ JSClass("JSSynchronizer", JSObject, {
45
45
  return this._scheduleSync(0, completion, target);
46
46
  },
47
47
 
48
+ _isPaused: false,
49
+ _syncOnResume: false,
50
+
51
+ pause: function(){
52
+ this._isPaused = true;
53
+ },
54
+
55
+ resume: function(){
56
+ this._isPaused = false;
57
+ if (this._syncOnResume){
58
+ this._syncOnResume = true;
59
+ this._scheduleSync(0, function(){});
60
+ }
61
+ },
62
+
48
63
  cancel: function(){
49
64
  if (this._pendingTimer !== null){
50
65
  this._pendingTimer.invalidate();
@@ -76,6 +91,10 @@ JSClass("JSSynchronizer", JSObject, {
76
91
  },
77
92
 
78
93
  _sync: function(){
94
+ if (this._isPaused){
95
+ this._syncOnResume = true;
96
+ return;
97
+ }
79
98
  this._pendingTimer = null;
80
99
  var controller = this;
81
100
  var started = false;
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ImageKit
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.MediaKit
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -16,7 +16,7 @@
16
16
  // #import "MKAsset.js"
17
17
  // #import "MKRemoteAsset.js"
18
18
  // #import "MKHTMLStream.js"
19
- /* global document */
19
+ /* global document, window */
20
20
  'use strict';
21
21
 
22
22
  (function(){
@@ -31,25 +31,51 @@ MKAsset.definePropertiesFromExtensions({
31
31
  }
32
32
  var video = document.createElement("video");
33
33
  video.playsInline = true;
34
- var loadmetadata = function(){
35
- video.currentTime = playbackTime;
34
+ video.crossOrigin = "anonymous";
35
+ var loadedmetadata = function(){
36
+ // logger.debug("loadedmetadata %f", video.currentTime);
37
+ video.removeEventListener("loadedmetadata", loadedmetadata);
38
+ };
39
+ var loadeddata = function(){
40
+ // logger.debug("loadeddata %f", video.currentTime);
41
+ video.removeEventListener("loadeddata", loadeddata);
36
42
  };
37
43
  var canplay = function(){
38
- // FIXME: would be nice to not have an arbitrary delay of 30ms, and
39
- // instead key off of an event when we know the poster can be captured
40
- JSTimer.scheduledTimerWithInterval(JSTimeInterval.milliseconds(30), capture);
44
+ // logger.debug("canplay %f", video.currentTime);
45
+ video.removeEventListener("canplay", canplay);
46
+ // logger.debug("setting time to %f", playbackTime);
47
+ video.currentTime = playbackTime;
48
+ video.addEventListener("timeupdate", timeupdate);
49
+ };
50
+ var timeupdate = function(){
51
+ // logger.debug("timeupdate %f", video.currentTime);
52
+ if (Math.abs(video.currentTime - playbackTime) > 0.02){
53
+ // logger.debug("correcting time to %f", playbackTime);
54
+ video.currentTime = playbackTime;
55
+ }else{
56
+ video.removeEventListener("timeupdate", timeupdate);
57
+ video.addEventListener("seeked", seeked);
58
+ }
59
+ };
60
+ var seeked = function(){
61
+ // logger.debug("seeked %f", video.currentTime);
62
+ video.removeEventListener("seeked", seeked);
63
+ // logger.debug("capture requested");
64
+ window.requestAnimationFrame(capture);
41
65
  };
42
66
  var capture = function(){
67
+ // logger.debug("capture");
43
68
  var canvas = document.createElement("canvas");
44
69
  canvas.width = video.videoWidth;
45
70
  canvas.height = video.videoHeight;
46
71
  var context = canvas.getContext("2d");
47
72
  context.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);
73
+ // logger.debug("drawn");
48
74
  canvas.toBlob(function(blob){
75
+ // logger.debug("blob");
49
76
  var reader = new FileReader();
50
77
  reader.addEventListener("loadend", function(){
51
- video.removeEventListener("loadmetadata", loadmetadata);
52
- video.removeEventListener("canplay", canplay);
78
+ // logger.debug("read");
53
79
  if (reader.error){
54
80
  logger.error("Error reading blob: %{error}", reader.error);
55
81
  completion.call(target, null);
@@ -57,13 +83,15 @@ MKAsset.definePropertiesFromExtensions({
57
83
  }
58
84
  var data = JSData.initWithBuffer(reader.result);
59
85
  var image = JSImage.initWithData(data);
86
+ // logger.debug("completion");
60
87
  completion.call(target, image);
61
88
  });
62
89
  reader.readAsArrayBuffer(blob);
63
90
  }, "image/jpeg");
64
91
  };
65
- video.addEventListener("loadmetadata", loadmetadata);
66
92
  video.addEventListener("canplay", canplay);
93
+ video.addEventListener("loadeddata", loadeddata);
94
+ video.addEventListener("loadedmetadata", loadedmetadata);
67
95
  if (this.isKindOfClass(MKHTMLStream)){
68
96
  video.srcObject = this.htmlMediaStream;
69
97
  }else if (this.isKindOfClass(MKRemoteAsset)){
@@ -72,6 +100,7 @@ MKAsset.definePropertiesFromExtensions({
72
100
  logger.warning("unsupported asset class: %{public}", this.$class.className);
73
101
  JSRunLoop.main.schedule(completion, target, null);
74
102
  }
103
+ video.load();
75
104
  return completion.promise;
76
105
  },
77
106
 
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.MediaKitUI
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -90,6 +90,7 @@ MKVideoView.definePropertiesFromExtensions({
90
90
  this.videoElement.srcObject = null;
91
91
  this.videoElement.src = null;
92
92
  }
93
+ this.videoElement.load();
93
94
  },
94
95
 
95
96
  _isWaitingForPlay: false,
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.NotificationKit
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2021 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -90,23 +90,23 @@ JSClass("NKHTMLUserNotificationCenter", NKUserNotificationCenter, {
90
90
 
91
91
  unregisterForRemoteNotifications: function(completion, target){
92
92
  if (!completion){
93
- completion = Promise.completion(Promise.rejectNonNullFirstArgument);
93
+ completion = Promise.completion(Promise.resolveNull);
94
94
  }
95
95
  if (this.serviceWorkerContainer === null){
96
- JSRunLoop.main.schedule(completion, target, new Error("Remote notifications not supported on this device (no service workers)"));
96
+ JSRunLoop.main.schedule(completion, target, null);
97
97
  }else{
98
98
  this.serviceWorkerContainer.getRegistration().then(function(serviceWorkerRegistration){
99
99
  if (!serviceWorkerRegistration){
100
- completion.call(target, new Error("Missing service worker registration"));
100
+ completion.call(target, null);
101
101
  return;
102
102
  }
103
103
  if (!serviceWorkerRegistration.pushManager){
104
- completion.call(target, new Error("Remote notifications not supported on this device (no push manager)"));
104
+ completion.call(target, null);
105
105
  return;
106
106
  }
107
107
  serviceWorkerRegistration.pushManager.getSubscription().then(function(subscription){
108
108
  if (subscription){
109
- subscription.unsubscribe(function(){
109
+ subscription.unsubscribe().then(function(){
110
110
  completion.call(target, null);
111
111
  }, function(error){
112
112
  completion.call(target, error);
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.PDFKit
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.QRKit
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.SearchKit
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.SecurityKit
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ServerKit
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ServerKitTesting
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.TestKit
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.UIKit
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.UIKitTesting
3
- JSBundleVersion: 2024.5.0
3
+ JSBundleVersion: 2024.6.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "node": ">=10.10.0"
10
10
  },
11
11
  "name": "@breakside/jskit",
12
- "version": "2024.5.0",
12
+ "version": "2024.6.0",
13
13
  "license": "SEE LICENSE IN LICENSE.txt",
14
14
  "files": [
15
15
  "*"