-
-
Notifications
You must be signed in to change notification settings - Fork 457
[WIP] Add a new feature media to simplify handling of media in Openhab #4709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
lo92fr
wants to merge
42
commits into
openhab:main
Choose a base branch
from
lo92fr:feature-media
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
78fddbd
proof of concept : add media support to openhab core
lo92fr bc96cd3
proof of concept : add media support to openhab core
lo92fr ffe0409
proof of concept : add media support to openhab core
lo92fr b9e66dd
add rest media endpoint
lo92fr 38203c8
add mediaService to media rest
lo92fr 0a69c41
add temp ignore
lo92fr deec590
add classpath/project files
lo92fr c5c192c
add MediaCollection node for Generic Collection
lo92fr 6a21918
add MediaListenner interface
lo92fr fac6d1c
add mediaListenner interface, progress on core modifications
lo92fr f96915b
add MediaBrowser to xsd
lo92fr a9c3676
add MediaBrowser
lo92fr 2fc1907
add proxy feature for internal Upnp ressource
lo92fr 4786567
div fixes on upnp browsing
lo92fr 08d40c5
enhance media api to return real data
lo92fr 05f6a42
first working version with playback to spotify !
lo92fr 11c4740
finally remove MediaBrowserItem, will concentrate evolution on existi…
lo92fr d29733c
Move MediaType to complexType so we can differentiate different type …
lo92fr dac8419
start adding MediaSink support to enable selecting output rendering d…
lo92fr 63f07b1
add preliminary support for target device change
lo92fr 7d2f05e
add binding info to MediaSinkDTO
lo92fr 3aaea50
introduce extended MediaType state on Player item to handle complex s…
lo92fr 0ad7a3b
add a first quick fix for PlayerItemTest failure, need review
lo92fr 3664eb2
adding proxy image stuff for UI layer
lo92fr 3c37fba
litlle fix on proxying function
lo92fr 25257d4
implements paging and lazy loading on MediaCollection (for now only t…
lo92fr 099fff9
div fixes on base media classes
lo92fr 224e995
first working version for searchbar (only working currently with spot…
lo92fr 7ebe6da
first working version for searchbar (only working currently with spot…
lo92fr 8a45248
first working version of global player widget
lo92fr e6f9c6c
review search functionnalities (WIP)
lo92fr c3825df
code cleanup : introduce MediaCommandType & MediaStateType
lo92fr e11020d
add getStreamUri signature
lo92fr b79d8a8
review pom on rest.media
lo92fr 7f1839f
spotless:apply
lo92fr 8923014
mvn spotless:apply
lo92fr 91409ac
temp fix for PlayerItemTest : need review
lo92fr e25c09a
try to fix test
lo92fr 787ed88
fix event drop in eventReceived when we use embedded device
lo92fr 9c23df1
review MediaStateType
lo92fr 09c88f9
add primary support for Media Queue
lo92fr 38747f1
code refactoring to remove duplicate code between addon that use medi…
lo92fr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
|
@@ -22,3 +22,4 @@ Californium.properties | |
|
||
generated/ | ||
userdata/ | ||
|
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" output="target/classes" path="src/main/java"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
<attribute name="optional" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
<attribute name="test" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
<attribute name="test" value="true"/> | ||
<attribute name="optional" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21"> | ||
<attributes> | ||
<attribute name="annotationpath" value="target/dependency"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | ||
<attributes> | ||
<attribute name="annotationpath" value="target/dependency"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.openhab.core.io.rest.media</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.m2e.core.maven2Builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.m2e.core.maven2Nature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.openhab.core.bundles</groupId> | ||
<artifactId>org.openhab.core.reactor.bundles</artifactId> | ||
<version>5.1.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>org.openhab.core.io.rest.media</artifactId> | ||
|
||
<name>openHAB Core :: Bundles :: Media REST Interface</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.openhab.core.bundles</groupId> | ||
<artifactId>org.openhab.core</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.openhab.core.bundles</groupId> | ||
<artifactId>org.openhab.core.media</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.openhab.core.bundles</groupId> | ||
<artifactId>org.openhab.core.thing</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.openhab.core.bundles</groupId> | ||
<artifactId>org.openhab.core.io.rest</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
46 changes: 46 additions & 0 deletions
46
...ab.core.io.rest.media/src/main/java/org/openhab/core/io/rest/media/internal/MediaDTO.java
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright (c) 2010-2025 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.core.io.rest.media.internal; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.eclipse.jdt.annotation.Nullable; | ||
|
||
/** | ||
* A DTO that is used on the REST API to provide infos about {@link AudioSource} to UIs. | ||
* | ||
* @author Laurent Arnal - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class MediaDTO { | ||
public String id; | ||
public String path; | ||
public String type; | ||
public @Nullable String artUri; | ||
public @Nullable String label; | ||
public @Nullable String complement; | ||
|
||
public MediaDTO(String id, String path, String type, String label) { | ||
this.id = id; | ||
this.path = path; | ||
this.type = type; | ||
this.label = label; | ||
} | ||
|
||
public void setArtUri(String artUri) { | ||
this.artUri = artUri; | ||
} | ||
|
||
public void setComplement(String complement) { | ||
this.complement = complement; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
....rest.media/src/main/java/org/openhab/core/io/rest/media/internal/MediaDTOCollection.java
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.openhab.core.io.rest.media.internal; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class MediaDTOCollection extends MediaDTO { | ||
private final List<MediaDTO> childs; | ||
|
||
public MediaDTOCollection(String id, String path, String type, String label) { | ||
super(id, path, type, label); | ||
childs = new ArrayList<>(); | ||
} | ||
|
||
public void addMediaDTO(MediaDTO mediaDTO) { | ||
childs.add(mediaDTO); | ||
} | ||
|
||
public List<MediaDTO> getChilds() { | ||
return childs; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing copyright header and class documentation.
Copilot uses AI. Check for mistakes.