Skip to content
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

Webserver video download #452

Merged
merged 2 commits into from
Sep 29, 2021
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
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.5.20'
ext.kotlin_version = '1.5.21'
repositories {
google()
jcenter()
Expand Down Expand Up @@ -154,8 +154,8 @@ configurations {
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation "androidx.coordinatorlayout:coordinatorlayout:1.1.0"
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.multidex:multidex:2.0.1'
Expand All @@ -182,7 +182,7 @@ dependencies {
implementation 'com.github.ybq:Android-SpinKit:1.4.0'
implementation 'io.github.silvaren:easyrs:0.5.3'
// jcodec's pure-java video coding replaced by android system encoding
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.4.21"
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.5.21"

// Room

Expand Down
8 changes: 6 additions & 2 deletions src/main/java/org/havenapp/main/service/WebServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,10 @@ else if (eventTrigger.getType() == EventTrigger.MICROPHONE)
page.append("<audio src=\"").append(mediaPath).append("\"></audio>");
page.append("<a href=\"").append(mediaPath).append("\">Download Media").append("</a>");

} else if (eventTrigger.getType() == EventTrigger.CAMERA_VIDEO) {
page.append("<video src=\"").append(mediaPath).append("\"></video>");
page.append("<a href=\"").append(mediaPath).append("\">Download Media").append("</a>");
}


page.append("<hr/>");
}

Expand Down Expand Up @@ -239,6 +240,9 @@ private String getMimeType (EventTrigger eventTrigger)
case EventTrigger.MICROPHONE:
sType = "audio/mp4";
break;
case EventTrigger.CAMERA_VIDEO:
sType = "video/*";
break;
default:
sType = null;
}
Expand Down