Skip to content

Commit

Permalink
fix videos
Browse files Browse the repository at this point in the history
  • Loading branch information
evandcoleman committed Oct 12, 2020
1 parent 8d45078 commit 6a2db10
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions Sources/XCTestHTMLReport/Classes/HTMLTemplates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,9 @@ struct HTMLTemplates
<h2>No Selected Attachment</h2>
<img src=\"\" class=\"displayed-screenshot\" id=\"screenshot\"/>
<iframe id=\"text-attachment\" src=\"\"></iframe>
<video class=\"displayed-video\" controls src=\"\" id=\"video\"/>
<video class=\"displayed-video\" controls crossOrigin="anonymous" id=\"video\">
<source src=\"\" type=\"video/mp4\" id=\"video-source\">
</video>
</div>
<div class=\"clear\"></div>
</div>
Expand All @@ -627,6 +629,7 @@ struct HTMLTemplates
sidebar, startX, startWidth, originalWidth,
screenshot = document.getElementById('screenshot'),
video = document.getElementById('video'),
videoSource = document.getElementById('video-source'),
iframe = document.getElementById('text-attachment');
for (var i = 0; i < resizers.length; i++) {
Expand Down Expand Up @@ -881,10 +884,11 @@ struct HTMLTemplates
hideAttachmentPlaceholder();
hideLog();
hideScreenshot();
var vid = document.getElementById('video-'+filename);
var vid = document.getElementById('video-source-'+filename);
video.style.display = \"block\";
video.src = vid.src;
video.play();
videoSource.src = vid.src;
video.load();
video.play().catch(console.log);
}
function setDisplayToElementsWithSelector(sel, display) {
Expand Down Expand Up @@ -1089,7 +1093,9 @@ struct HTMLTemplates
<span class=\"icon left video-icon\" style=\"margin-left: [[PADDING]]px\"></span>
[[NAME]]
<span class=\"icon preview-icon\" data=\"[[FILENAME]]\" onclick=\"showVideo('[[FILENAME]]')\"></span>
<video class=\"video\" controls src=\"[[SOURCE]]\" id=\"video-[[FILENAME]]\"/>
<video class=\"video\" controls src=\"[[SOURCE]]\" id=\"video-[[FILENAME]]\">
<source src=\"[[SOURCE]]\" type=\"video/mp4\" id=\"video-source-[[FILENAME]]\">
</video>
</p>
"""

Expand Down
2 changes: 1 addition & 1 deletion Sources/XCTestHTMLReport/main.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Darwin

var version = "2.2.6"
var version = "2.2.7"

print("XCTestHTMLReport \(version)")

Expand Down

0 comments on commit 6a2db10

Please sign in to comment.