@whereby.com/media 1.23.2 → 1.24.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.
package/dist/index.cjs CHANGED
@@ -2676,10 +2676,11 @@ function sortCodecsByPowerEfficiency(codecs) {
2676
2676
  }
2677
2677
  function sortCodecs(codecs, features) {
2678
2678
  return __awaiter(this, void 0, void 0, function* () {
2679
+ codecs = sortCodecsByMimeType(codecs, features);
2679
2680
  if (features.preferHardwareDecodingOn) {
2680
2681
  codecs = yield sortCodecsByPowerEfficiency(codecs);
2681
2682
  }
2682
- return sortCodecsByMimeType(codecs, features);
2683
+ return codecs;
2683
2684
  });
2684
2685
  }
2685
2686
 
@@ -3831,8 +3832,8 @@ class P2pRtcManager {
3831
3832
  }
3832
3833
  _setCodecPreferences(pc) {
3833
3834
  return __awaiter(this, void 0, void 0, function* () {
3834
- const { p2pVp9On, p2pAv1On, redOn, preferHardwareDecodingOn } = this._features;
3835
- if (!(p2pVp9On || p2pAv1On || redOn || preferHardwareDecodingOn)) {
3835
+ const { p2pVp9On, p2pAv1On, redOn, preferP2pHardwareDecodingOn } = this._features;
3836
+ if (!(p2pVp9On || p2pAv1On || redOn || preferP2pHardwareDecodingOn)) {
3836
3837
  return;
3837
3838
  }
3838
3839
  try {
@@ -3862,11 +3863,11 @@ class P2pRtcManager {
3862
3863
  if (videoTransceiver.setCodecPreferences === undefined)
3863
3864
  return;
3864
3865
  const capabilities = RTCRtpReceiver.getCapabilities("video");
3865
- if (p2pVp9On || p2pAv1On || preferHardwareDecodingOn) {
3866
+ if (p2pVp9On || p2pAv1On || preferP2pHardwareDecodingOn) {
3866
3867
  capabilities.codecs = yield sortCodecs(capabilities.codecs, {
3867
3868
  vp9On: p2pVp9On,
3868
3869
  av1On: p2pAv1On,
3869
- preferHardwareDecodingOn,
3870
+ preferHardwareDecodingOn: p2pVp9On || preferP2pHardwareDecodingOn,
3870
3871
  });
3871
3872
  }
3872
3873
  videoTransceiver.setCodecPreferences(capabilities.codecs);
package/dist/index.mjs CHANGED
@@ -2651,10 +2651,11 @@ function sortCodecsByPowerEfficiency(codecs) {
2651
2651
  }
2652
2652
  function sortCodecs(codecs, features) {
2653
2653
  return __awaiter(this, void 0, void 0, function* () {
2654
+ codecs = sortCodecsByMimeType(codecs, features);
2654
2655
  if (features.preferHardwareDecodingOn) {
2655
2656
  codecs = yield sortCodecsByPowerEfficiency(codecs);
2656
2657
  }
2657
- return sortCodecsByMimeType(codecs, features);
2658
+ return codecs;
2658
2659
  });
2659
2660
  }
2660
2661
 
@@ -3806,8 +3807,8 @@ class P2pRtcManager {
3806
3807
  }
3807
3808
  _setCodecPreferences(pc) {
3808
3809
  return __awaiter(this, void 0, void 0, function* () {
3809
- const { p2pVp9On, p2pAv1On, redOn, preferHardwareDecodingOn } = this._features;
3810
- if (!(p2pVp9On || p2pAv1On || redOn || preferHardwareDecodingOn)) {
3810
+ const { p2pVp9On, p2pAv1On, redOn, preferP2pHardwareDecodingOn } = this._features;
3811
+ if (!(p2pVp9On || p2pAv1On || redOn || preferP2pHardwareDecodingOn)) {
3811
3812
  return;
3812
3813
  }
3813
3814
  try {
@@ -3837,11 +3838,11 @@ class P2pRtcManager {
3837
3838
  if (videoTransceiver.setCodecPreferences === undefined)
3838
3839
  return;
3839
3840
  const capabilities = RTCRtpReceiver.getCapabilities("video");
3840
- if (p2pVp9On || p2pAv1On || preferHardwareDecodingOn) {
3841
+ if (p2pVp9On || p2pAv1On || preferP2pHardwareDecodingOn) {
3841
3842
  capabilities.codecs = yield sortCodecs(capabilities.codecs, {
3842
3843
  vp9On: p2pVp9On,
3843
3844
  av1On: p2pAv1On,
3844
- preferHardwareDecodingOn,
3845
+ preferHardwareDecodingOn: p2pVp9On || preferP2pHardwareDecodingOn,
3845
3846
  });
3846
3847
  }
3847
3848
  videoTransceiver.setCodecPreferences(capabilities.codecs);
@@ -2651,10 +2651,11 @@ function sortCodecsByPowerEfficiency(codecs) {
2651
2651
  }
2652
2652
  function sortCodecs(codecs, features) {
2653
2653
  return __awaiter(this, void 0, void 0, function* () {
2654
+ codecs = sortCodecsByMimeType(codecs, features);
2654
2655
  if (features.preferHardwareDecodingOn) {
2655
2656
  codecs = yield sortCodecsByPowerEfficiency(codecs);
2656
2657
  }
2657
- return sortCodecsByMimeType(codecs, features);
2658
+ return codecs;
2658
2659
  });
2659
2660
  }
2660
2661
 
@@ -3806,8 +3807,8 @@ class P2pRtcManager {
3806
3807
  }
3807
3808
  _setCodecPreferences(pc) {
3808
3809
  return __awaiter(this, void 0, void 0, function* () {
3809
- const { p2pVp9On, p2pAv1On, redOn, preferHardwareDecodingOn } = this._features;
3810
- if (!(p2pVp9On || p2pAv1On || redOn || preferHardwareDecodingOn)) {
3810
+ const { p2pVp9On, p2pAv1On, redOn, preferP2pHardwareDecodingOn } = this._features;
3811
+ if (!(p2pVp9On || p2pAv1On || redOn || preferP2pHardwareDecodingOn)) {
3811
3812
  return;
3812
3813
  }
3813
3814
  try {
@@ -3837,11 +3838,11 @@ class P2pRtcManager {
3837
3838
  if (videoTransceiver.setCodecPreferences === undefined)
3838
3839
  return;
3839
3840
  const capabilities = RTCRtpReceiver.getCapabilities("video");
3840
- if (p2pVp9On || p2pAv1On || preferHardwareDecodingOn) {
3841
+ if (p2pVp9On || p2pAv1On || preferP2pHardwareDecodingOn) {
3841
3842
  capabilities.codecs = yield sortCodecs(capabilities.codecs, {
3842
3843
  vp9On: p2pVp9On,
3843
3844
  av1On: p2pAv1On,
3844
- preferHardwareDecodingOn,
3845
+ preferHardwareDecodingOn: p2pVp9On || preferP2pHardwareDecodingOn,
3845
3846
  });
3846
3847
  }
3847
3848
  videoTransceiver.setCodecPreferences(capabilities.codecs);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@whereby.com/media",
3
3
  "description": "Media library for Whereby",
4
- "version": "1.23.2",
4
+ "version": "1.24.0",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/whereby/sdk",
7
7
  "repository": {