Skip to content

Commit

Permalink
Merge pull request #452 from archie94/webserver_video_download
Browse files Browse the repository at this point in the history
Webserver video download
  • Loading branch information
n8fr8 authored Sep 29, 2021
2 parents c12acbf + fa830bb commit ecc46dd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
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

0 comments on commit ecc46dd

Please sign in to comment.