Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions THIRD-PARTY-NOTICES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Third-Party Notices

This project bundles third-party assets, listed below with their licenses.

## Lucide icons

The audio and video file-type icons in `frontend/src/main/resources/icons/`
(`audio.svg`, `audio_dark.svg`, `video.svg`, `video_dark.svg`) are adapted from
[Lucide](https://lucide.dev) — the `music` and `film` icons, recolored and
resized for use in the IDE.

`film` is covered by Lucide's ISC license. `music` is one of Lucide's
Feather-derived icons and is covered by the MIT license. Both notices follow.

### ISC License

```
Copyright (c) 2026 Lucide Icons and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
```

### MIT License (for Feather-derived icons, including `music`)

```
Copyright (c) 2013-present Cole Bemis

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
13 changes: 13 additions & 0 deletions frontend/src/main/kotlin/dev/twango/jetplay/editor/JetplayIcons.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package dev.twango.jetplay.editor

import com.intellij.openapi.util.IconLoader
import javax.swing.Icon

object JetplayIcons {

@JvmField
val Audio: Icon = IconLoader.getIcon("/icons/audio.svg", JetplayIcons::class.java)

@JvmField
val Video: Icon = IconLoader.getIcon("/icons/video.svg", JetplayIcons::class.java)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package dev.twango.jetplay.editor

import com.intellij.ide.FileIconProvider
import com.intellij.openapi.project.DumbAware
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import dev.twango.jetplay.media.MediaClassification
import javax.swing.Icon

class MediaFileIconProvider :
FileIconProvider,
DumbAware {

override fun getIcon(file: VirtualFile, flags: Int, project: Project?): Icon? {
if (file.fileType != MediaFileType.INSTANCE) return null
val extension = file.extension ?: return null
return if (MediaClassification.isVideo(extension)) JetplayIcons.Video else JetplayIcons.Audio
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
implementationClass="dev.twango.jetplay.editor.MediaFileType"
fieldName="INSTANCE"
extensions="mp4;m4v;mkv;avi;mov;wmv;flv;webm;ogv;mts;m2ts;m2t;3gp;ivf;mp3;wav;ogg;oga;opus;m4a;aac;wma;aiff;aif;flac;ac3;eac3;caf;adts;amr;au;pcmu;ulaw;pcma;alaw;g722;gsm;sln"/>
<fileIconProvider implementation="dev.twango.jetplay.editor.MediaFileIconProvider"/>
<fileEditorProvider implementation="dev.twango.jetplay.editor.MediaFileEditorProvider"/>
<notificationGroup id="JetPlay" displayType="BALLOON"/>
</extensions>
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/main/resources/icons/audio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions frontend/src/main/resources/icons/audio_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions frontend/src/main/resources/icons/video.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions frontend/src/main/resources/icons/video_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package dev.twango.jetplay.editor

import org.junit.Assert.assertNotNull
import org.junit.Test

class MediaFileIconResourcesTest {

@Test
fun audioAndVideoIconsArePresentInBothThemes() {
listOf(
"/icons/audio.svg",
"/icons/audio_dark.svg",
"/icons/video.svg",
"/icons/video_dark.svg",
).forEach { path ->
assertNotNull("missing icon resource $path", javaClass.getResource(path))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package dev.twango.jetplay.media

object MediaClassification {

// Keep in sync with the video extensions in plugin.xml.
// Video extensions registered by the media file type in the frontend descriptor.
// .ts is excluded to avoid clobbering TypeScript files.
private val VIDEO_EXTENSIONS = setOf(
"mp4",
"m4v",
Expand All @@ -13,9 +14,9 @@ object MediaClassification {
"flv",
"webm",
"ogv",
"ts",
"mts",
"m2ts",
"m2t",
"3gp",
"ivf",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ class MediaClassificationTest {
assertFalse(MediaClassification.isVideo("opus"))
}

@Test
fun transportStreamContainersClassifyAsVideo() {
assertTrue(MediaClassification.isVideo("mts"))
assertTrue(MediaClassification.isVideo("m2ts"))
assertTrue(MediaClassification.isVideo("m2t"))
}

@Test
fun rawAudioExtensionsNeedTranscoding() {
MediaClassification.rawAudioExtensions.forEach {
Expand Down
Loading