Skip to content

Commit

Permalink
Merge pull request #2638 from CPogX/develop
Browse files Browse the repository at this point in the history
handle mp4 like any other media in Embed toMap()
ptrthomas authored Dec 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 6a9b56e + a9b438c commit 887c33a
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions karate-core/src/main/java/com/intuit/karate/core/Embed.java
Original file line number Diff line number Diff line change
@@ -108,15 +108,8 @@ public String getAsHtmlTag() {

public Map toMap() {
Map map = new HashMap(2);
if (resourceType == ResourceType.MP4) {
byte[] bytes = FileUtils.toBytes(getAsHtmlTag());
String base64 = Base64.getEncoder().encodeToString(bytes);
map.put("data", base64);
map.put("mime_type", ResourceType.HTML.contentType);
} else {
map.put("data", getBase64());
map.put("mime_type", resourceType.contentType);
}
map.put("data", getBase64());
map.put("mime_type", resourceType.contentType);
return map;
}

0 comments on commit 887c33a

Please sign in to comment.