Video orientation using video.js

左心房为你撑大大i 提交于 2020-01-06 05:40:06

问题


is it possible to set the orientation a .mp4 file in the video.js player? I don't see properties to do so such as Orientation="Portrait", but I was wondering if setting the width and height at runtime would do this.


回答1:


You should try out this plugin.

Video.js Zoom Rotate

A videoJS plugin to easily rotate or zoom in a video

https://github.com/xbgmsharp/videojs-rotatezoom




回答2:


The best to fix this it to rotate the actual video file. You can do this by using VLC Player.

  1. Go to Tools > Effects and Filters.
  2. Click on Video Effects->Geometry.
  3. Enable Transform and select Rotate by 90 degrees from the dropdown.

Other video libraries should rotate it too. (e.g. Windows Movie Maker)

the other option is to add this to your css

video{
  -moz-transform:rotate(90deg);
  -webkit-transform:rotate(90deg);
  -o-transform:rotate(90deg);
  -ms-transform:rotate(90deg);
  transform:rotate(90deg);
}

Note that this will transform your controls also however



来源:https://stackoverflow.com/questions/24415049/video-orientation-using-video-js

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!