mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-24 18:14:03 +02:00
feat: add media player in content view
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
<div ng-if="type == 'html'" ng-bind-html="content" class="file-content markdown-body"></div>
|
<div ng-if="type == 'html'" ng-bind-html="content" class="file-content markdown-body"></div>
|
||||||
<div ng-if="type == 'code' && content != null" ui-ace="aceOption" ng-model="content"></div>
|
<div ng-if="type == 'code' && content != null" ui-ace="aceOption" ng-model="content"></div>
|
||||||
<img ng-if="type == 'image'" class="image-content" ng-src="{{url}}"></img>
|
<img ng-if="type == 'image'" class="image-content" ng-src="{{url}}"></img>
|
||||||
|
<iframe class="h-100 overflow-auto w-100 b-0" ng-if="type == 'media'" ng-src="{{url}}"></iframe>
|
||||||
<div class="h-100 overflow-auto" ng-if="type == 'pdf'">
|
<div class="h-100 overflow-auto" ng-if="type == 'pdf'">
|
||||||
<pdfviewer class="h-100 overflow-auto" src="{{url}}" id="viewer"></pdfviewer>
|
<pdfviewer class="h-100 overflow-auto" src="{{url}}" id="viewer"></pdfviewer>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1488,6 +1488,17 @@ angular
|
|||||||
"heif",
|
"heif",
|
||||||
"heic",
|
"heic",
|
||||||
];
|
];
|
||||||
|
const mediaFiles = [
|
||||||
|
"wav",
|
||||||
|
"mp3",
|
||||||
|
"ogg",
|
||||||
|
"mp4",
|
||||||
|
"avi",
|
||||||
|
"webm",
|
||||||
|
"mov",
|
||||||
|
"mpg",
|
||||||
|
"wma",
|
||||||
|
];
|
||||||
|
|
||||||
$scope.$on("$routeUpdate", function (event, current) {
|
$scope.$on("$routeUpdate", function (event, current) {
|
||||||
if (($routeParams.path || "") == $scope.filePath) {
|
if (($routeParams.path || "") == $scope.filePath) {
|
||||||
@@ -1601,6 +1612,9 @@ angular
|
|||||||
if (imageFiles.indexOf(extension) > -1) {
|
if (imageFiles.indexOf(extension) > -1) {
|
||||||
return "image";
|
return "image";
|
||||||
}
|
}
|
||||||
|
if (mediaFiles.indexOf(extension) > -1) {
|
||||||
|
return "media";
|
||||||
|
}
|
||||||
return "code";
|
return "code";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user