code style cleanup
This commit is contained in:
parent
452fa34b36
commit
7c43c185f5
3 changed files with 12 additions and 19 deletions
|
@ -1,5 +1,6 @@
|
|||
"use strict";
|
||||
|
||||
const flvjs = require("flv.js");
|
||||
const iosCorrectedInnerHeight = require("ios-inner-height");
|
||||
const router = require("../router.js");
|
||||
const views = require("../util/views.js");
|
||||
|
@ -50,10 +51,7 @@ class PostMainView {
|
|||
postContainerNode.querySelector(".post-overlay"),
|
||||
ctx.post
|
||||
);
|
||||
// suppurt flv play
|
||||
if (ctx.post.mimeType === "video/x-flv") {
|
||||
const flvjs = require("flv.js");
|
||||
if (flvjs.isSupported()) {
|
||||
if (ctx.post.mimeType === "video/x-flv" && flvjs.isSupported()) {
|
||||
const video = document.querySelector(".post-content video");
|
||||
const src = video.querySelector("source").src
|
||||
const player = flvjs.createPlayer({
|
||||
|
@ -63,7 +61,6 @@ class PostMainView {
|
|||
player.attachMediaElement(video);
|
||||
player.load();
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx.post.type === "video" || ctx.post.type === "flash") {
|
||||
this._postContentControl.disableOverlay();
|
||||
|
|
|
@ -66,12 +66,8 @@ def get_extension(mime_type: str) -> Optional[str]:
|
|||
def is_flash(mime_type: str) -> bool:
|
||||
return mime_type.lower() == "application/x-shockwave-flash"
|
||||
|
||||
def is_flv(mime_type: str) -> bool:
|
||||
return mime_type.lower() == "video/x-flv"
|
||||
|
||||
|
||||
def is_video(mime_type: str) -> bool:
|
||||
return mime_type.lower() in ("application/ogg", "video/mp4", "video/webm")
|
||||
return mime_type.lower() in ("application/ogg", "video/mp4", "video/webm", "video/x-flv")
|
||||
|
||||
|
||||
def is_image(mime_type: str) -> bool:
|
||||
|
|
|
@ -619,7 +619,7 @@ def update_post_content(post: model.Post, content: Optional[bytes]) -> None:
|
|||
post.type = model.Post.TYPE_ANIMATION
|
||||
else:
|
||||
post.type = model.Post.TYPE_IMAGE
|
||||
elif mime.is_video(post.mime_type) or mime.is_flv(post.mime_type):
|
||||
elif mime.is_video(post.mime_type):
|
||||
post.type = model.Post.TYPE_VIDEO
|
||||
else:
|
||||
raise InvalidPostContentError(
|
||||
|
|
Reference in a new issue