capacitor-native-video-compressor 1.1.2 → 1.1.3

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.
@@ -99,7 +99,7 @@ public class VideoCompressionService extends Service {
99
99
  NotificationChannel channel = new NotificationChannel(
100
100
  CHANNEL_ID, "Xử lý và tải video lên", NotificationManager.IMPORTANCE_LOW
101
101
  );
102
- channel.setDescription("Tiến trình nén và tải video lên khi bạn dùng ứng dụng khác");
102
+ channel.setDescription("Tiến trình nén và tải video lên");
103
103
  NotificationManager manager = getSystemService(NotificationManager.class);
104
104
  if (manager != null) manager.createNotificationChannel(channel);
105
105
  }
@@ -207,13 +207,22 @@ public class VideoCompressionService extends Service {
207
207
  title = shown.phase == Phase.UPLOADING ? "Đang tải video lên" : "Đang nén video";
208
208
  }
209
209
 
210
+ // Hai pha nói hai điều khác nhau, vì chúng chạy ở hai nơi khác nhau.
211
+ //
212
+ // Nén chạy ở native trong chính service này nên vẫn chạy khi app
213
+ // xuống nền. Upload thì chạy bằng JS trong webview, nên nó đứng lại
214
+ // và chỉ tiếp tục khi app trở lại foreground - đo được: nén xong là
215
+ // mọi hoạt động mạng dừng hẳn cho tới khi watchdog tự dừng service
216
+ // sau 15 phút. Vì vậy pha upload phải nói rõ việc người dùng cần làm.
210
217
  String text;
211
- if (indeterminate) {
212
- text = "Đang tải lên, sẽ tiếp tục khi bạn dùng ứng dụng khác";
218
+ if (shown.phase == Phase.UPLOADING) {
219
+ text = indeterminate
220
+ ? "Mở lại ứng dụng để hoàn tất tải lên"
221
+ : shown.percent + "% - mở lại ứng dụng để hoàn tất tải lên";
213
222
  } else {
214
- text = shown.percent + "% - "
215
- + (shown.phase == Phase.UPLOADING ? "đang tải lên" : "đang nén")
216
- + ", sẽ tiếp tục khi bạn dùng ứng dụng khác";
223
+ text = indeterminate
224
+ ? "Đang nén video"
225
+ : shown.percent + "% - đang nén";
217
226
  }
218
227
 
219
228
  Notification notification = new NotificationCompat.Builder(this, CHANNEL_ID)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-native-video-compressor",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Native video compressor using LightCompressor and AVFoundation",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",