@capgo/capacitor-video-player 8.0.5 → 8.0.7
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/android/src/main/java/com/capgo/videoplayer/FullscreenExoPlayerFragment.java +17 -28
- package/android/src/main/java/com/capgo/videoplayer/PickerVideo/PickerVideoFragment.java +0 -2
- package/android/src/main/java/com/capgo/videoplayer/VideoPlayerPlugin.java +1 -1
- package/ios/Sources/VideoPlayerPlugin/VideoPlayerPlugin.swift +1 -1
- package/package.json +1 -1
|
@@ -79,7 +79,6 @@ import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter;
|
|
|
79
79
|
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
|
|
80
80
|
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource;
|
|
81
81
|
import com.google.android.exoplayer2.util.MimeTypes;
|
|
82
|
-
import com.google.android.exoplayer2.util.Util;
|
|
83
82
|
import com.google.android.gms.cast.framework.CastButtonFactory;
|
|
84
83
|
import com.google.android.gms.cast.framework.CastContext;
|
|
85
84
|
import com.google.android.gms.cast.framework.CastState;
|
|
@@ -179,7 +178,6 @@ public class FullscreenExoPlayerFragment extends Fragment {
|
|
|
179
178
|
private Boolean isPIPModeEnabled = true;
|
|
180
179
|
final Handler handler = new Handler();
|
|
181
180
|
final Runnable mRunnable = new Runnable() {
|
|
182
|
-
@RequiresApi(api = Build.VERSION_CODES.N)
|
|
183
181
|
public void run() {
|
|
184
182
|
checkPIPPermission();
|
|
185
183
|
}
|
|
@@ -333,7 +331,7 @@ public class FullscreenExoPlayerFragment extends Fragment {
|
|
|
333
331
|
NotificationCenter.defaultCenter().postNotification("playerItemPlay", info);
|
|
334
332
|
resizeBtn.setVisibility(View.VISIBLE);
|
|
335
333
|
|
|
336
|
-
if (
|
|
334
|
+
if (pipEnabled) {
|
|
337
335
|
pipBtn.setVisibility(View.VISIBLE);
|
|
338
336
|
}
|
|
339
337
|
} else {
|
|
@@ -531,7 +529,6 @@ public class FullscreenExoPlayerFragment extends Fragment {
|
|
|
531
529
|
}
|
|
532
530
|
if (
|
|
533
531
|
!isInPictureInPictureMode &&
|
|
534
|
-
Build.VERSION.SDK_INT >= Build.VERSION_CODES.N &&
|
|
535
532
|
packageManager.hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE) &&
|
|
536
533
|
isPIPModeEnabled &&
|
|
537
534
|
pipEnabled &&
|
|
@@ -590,7 +587,7 @@ public class FullscreenExoPlayerFragment extends Fragment {
|
|
|
590
587
|
* Perform pictureInPictureMode Action
|
|
591
588
|
*/
|
|
592
589
|
private void pictureInPictureMode() {
|
|
593
|
-
if (
|
|
590
|
+
if (packageManager.hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE)) {
|
|
594
591
|
styledPlayerView.setUseController(false);
|
|
595
592
|
styledPlayerView.setControllerAutoShow(false);
|
|
596
593
|
linearLayout.setVisibility(View.INVISIBLE);
|
|
@@ -622,7 +619,6 @@ public class FullscreenExoPlayerFragment extends Fragment {
|
|
|
622
619
|
}
|
|
623
620
|
}
|
|
624
621
|
|
|
625
|
-
@RequiresApi(api = Build.VERSION_CODES.N)
|
|
626
622
|
private void checkPIPPermission() {
|
|
627
623
|
isPIPModeEnabled = isInPictureInPictureMode;
|
|
628
624
|
if (!isInPictureInPictureMode) {
|
|
@@ -638,19 +634,17 @@ public class FullscreenExoPlayerFragment extends Fragment {
|
|
|
638
634
|
super.onStart();
|
|
639
635
|
//if (chromecast && castContext != null) mRouter.addCallback(mSelector, mCallback, MediaRouter.CALLBACK_FLAG_REQUEST_DISCOVERY);
|
|
640
636
|
|
|
641
|
-
if (
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
if (castContext != null && chromecast && castPlayer.isCastSessionAvailable()) return;
|
|
637
|
+
if (styledPlayerView != null) {
|
|
638
|
+
// If cast is playing then it doesn't start the local player once get backs from background
|
|
639
|
+
if (castContext != null && chromecast && castPlayer.isCastSessionAvailable()) return;
|
|
645
640
|
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
}
|
|
651
|
-
} else {
|
|
652
|
-
getActivity().finishAndRemoveTask();
|
|
641
|
+
initializePlayer();
|
|
642
|
+
if (player.getCurrentPosition() != 0) {
|
|
643
|
+
firstReadyToPlay = false;
|
|
644
|
+
play();
|
|
653
645
|
}
|
|
646
|
+
} else {
|
|
647
|
+
getActivity().finishAndRemoveTask();
|
|
654
648
|
}
|
|
655
649
|
}
|
|
656
650
|
|
|
@@ -690,17 +684,12 @@ public class FullscreenExoPlayerFragment extends Fragment {
|
|
|
690
684
|
if (bkModeEnabled) isAppBackground = isApplicationSentToBackground(context);
|
|
691
685
|
|
|
692
686
|
if (!isInPictureInPictureMode) {
|
|
693
|
-
if (
|
|
694
|
-
if (player != null)
|
|
695
|
-
|
|
696
|
-
} else {
|
|
697
|
-
if (isAppBackground) {
|
|
698
|
-
if (player != null) {
|
|
699
|
-
if (player.isPlaying()) play();
|
|
700
|
-
}
|
|
701
|
-
} else {
|
|
702
|
-
pause();
|
|
687
|
+
if (isAppBackground) {
|
|
688
|
+
if (player != null) {
|
|
689
|
+
if (player.isPlaying()) play();
|
|
703
690
|
}
|
|
691
|
+
} else {
|
|
692
|
+
pause();
|
|
704
693
|
}
|
|
705
694
|
} else {
|
|
706
695
|
if (linearLayout.getVisibility() == View.VISIBLE) {
|
|
@@ -742,7 +731,7 @@ public class FullscreenExoPlayerFragment extends Fragment {
|
|
|
742
731
|
//if (chromecast && castContext != null) castContext.addCastStateListener(castStateListener);
|
|
743
732
|
if (!isInPictureInPictureMode) {
|
|
744
733
|
hideSystemUi();
|
|
745
|
-
if (
|
|
734
|
+
if (player == null) {
|
|
746
735
|
initializePlayer();
|
|
747
736
|
}
|
|
748
737
|
} else {
|
|
@@ -12,7 +12,6 @@ import android.util.Log;
|
|
|
12
12
|
import android.view.LayoutInflater;
|
|
13
13
|
import android.view.View;
|
|
14
14
|
import android.view.ViewGroup;
|
|
15
|
-
import androidx.annotation.RequiresApi;
|
|
16
15
|
import androidx.fragment.app.Fragment;
|
|
17
16
|
import androidx.recyclerview.widget.GridLayoutManager;
|
|
18
17
|
import androidx.recyclerview.widget.RecyclerView;
|
|
@@ -42,7 +41,6 @@ public class PickerVideoFragment extends Fragment {
|
|
|
42
41
|
* @return View
|
|
43
42
|
*/
|
|
44
43
|
@SuppressWarnings("serial")
|
|
45
|
-
@RequiresApi(api = Build.VERSION_CODES.M)
|
|
46
44
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
|
47
45
|
context = container.getContext();
|
|
48
46
|
// Inflate the layout for this fragment
|
|
@@ -38,7 +38,7 @@ import java.util.Map;
|
|
|
38
38
|
)
|
|
39
39
|
public class VideoPlayerPlugin extends Plugin {
|
|
40
40
|
|
|
41
|
-
private final String pluginVersion = "8.0.
|
|
41
|
+
private final String pluginVersion = "8.0.7";
|
|
42
42
|
|
|
43
43
|
// Permission alias constants
|
|
44
44
|
private static final String PERMISSION_DENIED_ERROR = "Unable to access media videos, user denied permission request";
|
|
@@ -8,7 +8,7 @@ import AVKit
|
|
|
8
8
|
*/
|
|
9
9
|
@objc(VideoPlayerPlugin)
|
|
10
10
|
public class VideoPlayerPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
11
|
-
private let pluginVersion: String = "8.0.
|
|
11
|
+
private let pluginVersion: String = "8.0.7"
|
|
12
12
|
public let identifier = "VideoPlayerPlugin"
|
|
13
13
|
public let jsName = "VideoPlayer"
|
|
14
14
|
public let pluginMethods: [CAPPluginMethod] = [
|