-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new Compose way to integrate with vlcj
- Loading branch information
Showing
3 changed files
with
138 additions
and
29 deletions.
There are no files selected for viewing
46 changes: 40 additions & 6 deletions
46
...onents/VideoPlayer/demo/src/jvmMain/kotlin/org/jetbrains/compose/videoplayer/demo/Main.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,56 @@ | ||
package org.jetbrains.compose.videoplayer.demo | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.* | ||
import androidx.compose.material.MaterialTheme | ||
import androidx.compose.material.Text | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
import androidx.compose.ui.window.WindowState | ||
import androidx.compose.ui.window.singleWindowApplication | ||
import org.jetbrains.compose.videoplayer.VideoPlayer | ||
import org.jetbrains.compose.videoplayer.VideoPlayerCompose | ||
import org.jetbrains.compose.videoplayer.VideoPlayerSwing | ||
|
||
fun main() { | ||
singleWindowApplication( | ||
title = "Video Player", | ||
state = WindowState(width = 800.dp, height = 800.dp) | ||
) { | ||
MaterialTheme { | ||
VideoPlayer( | ||
url = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", | ||
width = 640, | ||
height = 480 | ||
) | ||
Column( | ||
modifier = Modifier.fillMaxSize(), | ||
verticalArrangement = Arrangement.Center, | ||
horizontalAlignment = Alignment.CenterHorizontally | ||
) { | ||
Spacer(modifier = Modifier.height(8.dp)) | ||
Text( | ||
text = "Swing Video Player", | ||
fontSize = 18.sp, | ||
color = Color.Black | ||
) | ||
Spacer(modifier = Modifier.height(8.dp)) | ||
VideoPlayerSwing( | ||
url = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", | ||
width = 480, | ||
height = 360 | ||
) | ||
Spacer(modifier = Modifier.height(8.dp)) | ||
Box(modifier = Modifier.background(Color.Black), contentAlignment = Alignment.Center) { | ||
VideoPlayerCompose( | ||
url = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", | ||
width = 480, | ||
height = 360 | ||
) | ||
Text( | ||
text = "Compose Video Player", | ||
fontSize = 18.sp, | ||
color = Color.White | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 88 additions & 20 deletions
108
...er/library/src/desktopMain/kotlin/org/jetbrains/compose/videoplayer/DesktopVideoPlayer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters