-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/v1.0.0' into master
- Loading branch information
Showing
28 changed files
with
1,101 additions
and
31 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# (2020-10-19) | ||
|
||
|
||
### Bug Fixes | ||
|
||
* add a public class ([c04008e](https://github.com/johnnymillergh/media-streaming/commit/c04008e472f85db9b3e19ef357d5622518d61e6e)) | ||
* add method comments ([0da2555](https://github.com/johnnymillergh/media-streaming/commit/0da25556a5f2a15cd56a29d8bafd5f8f7b1fa5b6)) | ||
* delete unknown tag `date` ([8297f99](https://github.com/johnnymillergh/media-streaming/commit/8297f99461cb65d82107e3a292cce7daad466c24)) | ||
* **Travis:** add file permission before install ([70496a9](https://github.com/johnnymillergh/media-streaming/commit/70496a93d587fc7885809b9c556ca8225a098ae5)) | ||
|
||
|
||
### Build System | ||
|
||
* **Project:** initial project ([6a1d485](https://github.com/johnnymillergh/media-streaming/commit/6a1d485af78e802e4ccc8a3c147fdcba72516be7)) | ||
|
||
|
||
### Features | ||
|
||
* **Exception:** add class `MediaStreamingExceptionHandler` ([c682c3a](https://github.com/johnnymillergh/media-streaming/commit/c682c3a6bb8c613c12cb646a8b95129d2a197f28)) | ||
* **Exception:** add customized exception class ([4cc6667](https://github.com/johnnymillergh/media-streaming/commit/4cc6667c1424e52e94622177d60c974ea9efeda2)) | ||
* **media-streaming:** implement basic media streaming ability ([2ff9cd0](https://github.com/johnnymillergh/media-streaming/commit/2ff9cd0e00bb3c8d3fe8f104a0d6145d1d2fbfcf)) | ||
* **WebFlux:** integrate and configure WebFlux ([4b14363](https://github.com/johnnymillergh/media-streaming/commit/4b143635f395ec69b60675524b21b91c9284b6cd)) | ||
|
||
|
||
### BREAKING CHANGES | ||
|
||
* **media-streaming:** implement basic media streaming ability | ||
* **Project:** built the basic structure for | ||
media-streaming-spring-boot-starter | ||
|
||
|
||
|
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
1 change: 0 additions & 1 deletion
1
media-streaming-sample-app/src/main/resources/application.properties
This file was deleted.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
media-streaming-sample-app/src/main/resources/application.yml
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
media-streaming: | ||
video-directory-on-file-system: 'C:\\Users\\Johnny\\Videos\\Mine' |
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
11 changes: 0 additions & 11 deletions
11
...src/main/java/com/jmframework/boot/mediastreamingspringbootautoconfigure/Placeholder.java
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
...main/java/com/jmframework/boot/mediastreamingspringbootautoconfigure/api/VideoRoutes.java
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.jmframework.boot.mediastreamingspringbootautoconfigure.api; | ||
|
||
import com.jmframework.boot.mediastreamingspringbootautoconfigure.handler.VideoRouteHandler; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.reactive.function.server.RequestPredicate; | ||
import org.springframework.web.reactive.function.server.RequestPredicates; | ||
import org.springframework.web.reactive.function.server.RouterFunction; | ||
import org.springframework.web.reactive.function.server.ServerResponse; | ||
|
||
import static org.springframework.web.reactive.function.server.RequestPredicates.path; | ||
import static org.springframework.web.reactive.function.server.RouterFunctions.route; | ||
|
||
/** | ||
* Description: VideoRoutes, change description here. | ||
* | ||
* @author Johnny Miller (锺俊), email: [email protected], date: 10/19/2020 4:38 PM | ||
**/ | ||
@Configuration | ||
public class VideoRoutes { | ||
@Bean | ||
RouterFunction<ServerResponse> videoEndPoint(VideoRouteHandler videoRouteHandler) { | ||
return route() | ||
.nest(path("/videos"), builder -> builder.GET("", videoRouteHandler::listVideos) | ||
.nest(path("/{name}"), videoBuilder -> videoBuilder.GET("", param("partial"), | ||
videoRouteHandler::getPartialContent).GET("", videoRouteHandler::getFullContent) | ||
) | ||
).build(); | ||
} | ||
|
||
private static RequestPredicate param(String parameter) { | ||
return RequestPredicates.all().and(request -> request.queryParam(parameter).isPresent()); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
...a/com/jmframework/boot/mediastreamingspringbootautoconfigure/configuration/Bootstrap.java
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.jmframework.boot.mediastreamingspringbootautoconfigure.configuration; | ||
|
||
import com.jmframework.boot.mediastreamingspringbootautoconfigure.model.Video; | ||
import com.jmframework.boot.mediastreamingspringbootautoconfigure.repository.VideoRepository; | ||
import com.jmframework.boot.mediastreamingspringbootautoconfigure.services.FileService; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.boot.CommandLineRunner; | ||
import org.springframework.stereotype.Component; | ||
|
||
/** | ||
* Description: Bootstrap, change description here. | ||
* | ||
* @author 钟俊, email: [email protected], date: 10/19/2020 2:51 PM | ||
**/ | ||
@Slf4j | ||
@Component | ||
@RequiredArgsConstructor | ||
public class Bootstrap implements CommandLineRunner { | ||
private final VideoRepository videoRepository; | ||
private final FileService fileService; | ||
|
||
@Override | ||
public void run(String... args) { | ||
fileService.getAllFiles() | ||
.doOnNext(path -> log.debug("found file in path: " + path.toUri() + " FileName: " + path.getFileName())) | ||
.flatMap(path -> { | ||
Video video = new Video(); | ||
video.setName(path.getFileName().toString()); | ||
video.setLocation(path); | ||
return videoRepository.addVideo(video); | ||
}) | ||
.subscribe(); | ||
|
||
videoRepository.getAllVideos() | ||
.doOnNext(video -> log.info("Registered video: " + video.getName())) | ||
.subscribe(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
.../mediastreamingspringbootautoconfigure/configuration/MediaStreamingAutoConfiguration.java
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.jmframework.boot.mediastreamingspringbootautoconfigure.configuration; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import javax.annotation.PostConstruct; | ||
|
||
/** | ||
* Description: MediaStreamingAutoConfiguration, change description here. | ||
* | ||
* @author 钟俊, email: [email protected], date: 10/19/2020 2:51 PM | ||
**/ | ||
@Slf4j | ||
@Configuration | ||
@RequiredArgsConstructor | ||
@EnableConfigurationProperties(MediaStreamingProperties.class) | ||
public class MediaStreamingAutoConfiguration { | ||
private final MediaStreamingProperties mediaStreamingProperties; | ||
|
||
@PostConstruct | ||
public void afterInitialization() { | ||
log.info("afterInitialization: {}", mediaStreamingProperties); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...rk/boot/mediastreamingspringbootautoconfigure/configuration/MediaStreamingProperties.java
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.jmframework.boot.mediastreamingspringbootautoconfigure.configuration; | ||
|
||
import lombok.Data; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
|
||
/** | ||
* Description: MediaStreamingProperties, change description here. | ||
* | ||
* @author Johnny Miller (锺俊), email: [email protected] | ||
* date 10/19/2020 3:28 PM | ||
**/ | ||
@Data | ||
@ConfigurationProperties(prefix = MediaStreamingProperties.PREFIX) | ||
public class MediaStreamingProperties { | ||
public static final String PREFIX = "media-streaming"; | ||
/** | ||
* Video directory on file system | ||
*/ | ||
private String videoDirectoryOnFileSystem; | ||
} |
Oops, something went wrong.