Video call can be static
This commit is contained in:
parent
6e6cf3a86a
commit
3afb86c22c
|
@ -73,7 +73,7 @@
|
|||
<ID>TooGenericExceptionCaught:MediaPlayerService.kt$MediaPlayerService$e: Exception</ID>
|
||||
<ID>TooGenericExceptionCaught:SongView.kt$SongView$e: Exception</ID>
|
||||
<ID>TooGenericExceptionCaught:SubsonicUncaughtExceptionHandler.kt$SubsonicUncaughtExceptionHandler$x: Throwable</ID>
|
||||
<ID>TooGenericExceptionCaught:VideoPlayer.kt$VideoPlayer$e: Exception</ID>
|
||||
<ID>TooGenericExceptionCaught:VideoPlayer.kt$VideoPlayer.Companion$e: Exception</ID>
|
||||
<ID>TooGenericExceptionThrown:DownloadFile.kt$DownloadFile.DownloadTask$throw Exception(String.format("Download of '%s' was cancelled", song))</ID>
|
||||
<ID>TooManyFunctions:LocalMediaPlayer.kt$LocalMediaPlayer</ID>
|
||||
<ID>TooManyFunctions:MediaPlayerService.kt$MediaPlayerService : Service</ID>
|
||||
|
|
|
@ -52,7 +52,6 @@ public class BookmarksFragment extends Fragment {
|
|||
private ImageView downloadButton;
|
||||
private ImageView deleteButton;
|
||||
|
||||
private final Lazy<VideoPlayer> videoPlayer = inject(VideoPlayer.class);
|
||||
private final Lazy<MediaPlayerController> mediaPlayerController = inject(MediaPlayerController.class);
|
||||
private final Lazy<ImageLoaderProvider> imageLoader = inject(ImageLoaderProvider.class);
|
||||
private final Lazy<NetworkAndStorageChecker> networkAndStorageChecker = inject(NetworkAndStorageChecker.class);
|
||||
|
@ -104,7 +103,7 @@ public class BookmarksFragment extends Fragment {
|
|||
{
|
||||
if (entry.isVideo())
|
||||
{
|
||||
videoPlayer.getValue().playVideo(getContext(), entry);
|
||||
VideoPlayer.Companion.playVideo(getContext(), entry);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -85,7 +85,6 @@ public class SearchFragment extends Fragment {
|
|||
private EntryAdapter songAdapter;
|
||||
private SwipeRefreshLayout searchRefresh;
|
||||
|
||||
private final Lazy<VideoPlayer> videoPlayer = inject(VideoPlayer.class);
|
||||
private final Lazy<MediaPlayerController> mediaPlayerControllerLazy = inject(MediaPlayerController.class);
|
||||
private final Lazy<ImageLoaderProvider> imageLoaderProvider = inject(ImageLoaderProvider.class);
|
||||
private final Lazy<DownloadHandler> downloadHandler = inject(DownloadHandler.class);
|
||||
|
@ -576,7 +575,7 @@ public class SearchFragment extends Fragment {
|
|||
|
||||
private void onVideoSelected(MusicDirectory.Entry entry)
|
||||
{
|
||||
videoPlayer.getValue().playVideo(getContext(), entry);
|
||||
VideoPlayer.Companion.playVideo(getContext(), entry);
|
||||
}
|
||||
|
||||
private void autoplay()
|
||||
|
|
|
@ -21,7 +21,6 @@ import org.moire.ultrasonic.subsonic.DownloadHandler
|
|||
import org.moire.ultrasonic.subsonic.ImageLoaderProvider
|
||||
import org.moire.ultrasonic.subsonic.NetworkAndStorageChecker
|
||||
import org.moire.ultrasonic.subsonic.ShareHandler
|
||||
import org.moire.ultrasonic.subsonic.VideoPlayer
|
||||
import org.moire.ultrasonic.util.Constants
|
||||
|
||||
/**
|
||||
|
@ -76,6 +75,5 @@ val musicServiceModule = module {
|
|||
|
||||
single { DownloadHandler(get(), get()) }
|
||||
single { NetworkAndStorageChecker(androidContext()) }
|
||||
single { VideoPlayer() }
|
||||
single { ShareHandler(androidContext()) }
|
||||
}
|
||||
|
|
|
@ -81,7 +81,6 @@ class TrackCollectionFragment : Fragment() {
|
|||
private var shareButton: MenuItem? = null
|
||||
|
||||
private val mediaPlayerController: MediaPlayerController by inject()
|
||||
private val videoPlayer: VideoPlayer by inject()
|
||||
private val downloadHandler: DownloadHandler by inject()
|
||||
private val networkAndStorageChecker: NetworkAndStorageChecker by inject()
|
||||
private val imageLoaderProvider: ImageLoaderProvider by inject()
|
||||
|
@ -140,7 +139,7 @@ class TrackCollectionFragment : Fragment() {
|
|||
bundle
|
||||
)
|
||||
} else if (entry != null && entry.isVideo) {
|
||||
videoPlayer.playVideo(requireContext(), entry)
|
||||
VideoPlayer.playVideo(requireContext(), entry)
|
||||
} else {
|
||||
enableButtons()
|
||||
}
|
||||
|
|
|
@ -11,7 +11,9 @@ import org.moire.ultrasonic.util.Util
|
|||
/**
|
||||
* This utility class helps starting video playback
|
||||
*/
|
||||
@Suppress("UtilityClassWithPublicConstructor")
|
||||
class VideoPlayer {
|
||||
companion object {
|
||||
fun playVideo(context: Context, entry: MusicDirectory.Entry?) {
|
||||
if (!Util.isNetworkConnected() || entry == null) {
|
||||
Util.toast(context, R.string.select_album_no_network)
|
||||
|
@ -30,3 +32,4 @@ class VideoPlayer {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue