[英]HTML5 video poster image being shown sideways
Anyone seen this before? 有人看过吗?
When I set the poster attribute to a fileURL using the following code, the images are sometimes sideways or upside down. 当我使用以下代码将poster属性设置为fileURL时,图像有时会横向或上下颠倒。
var showLocalThumbnailVideoInPlayer = function(file) {
var URL = window.URL || window.webkitURL;
var fileURL = URL.createObjectURL(file);
var videoNode = document.querySelector('video');
videoNode.poster = fileURL;
videoNode.load();
};
The file is coming from an HTML input tag where the user selects the file from the local file system. 该文件来自HTML输入标签,用户可在其中从本地文件系统中选择文件。
I am trying to get this to work on both iOS, Android, and Desktop with little changes between them (hence HTML5). 我正在尝试使其在iOS,Android和台式机上都能正常运行,并且它们之间没有什么变化(因此HTML5)。
Thoughts about what's happening? 关于正在发生的事情的想法?
I figured out what was happening. 我知道发生了什么事。
The EXIF data is ignored as per the HTML specifications and so the image needs to be rotated in memory first. 根据HTML规范,EXIF数据将被忽略,因此需要首先在内存中旋转图像。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.