RichEditor icon indicating copy to clipboard operation
RichEditor copied to clipboard

插入的video宽度为啥没有填充屏幕宽度,显示的很窄,请问下可以修改那里实现吗

Open liqiangCoding opened this issue 5 years ago • 2 comments

liqiangCoding avatar Feb 21 '20 03:02 liqiangCoding

你点进去insertVideo 查看 max-width:100% 默认是铺满的 想改的话也是该这段 还是html的逻辑 `/** * @param videoUrl * @param customStyle * @param posterUrl 视频默认缩略图 */ public void insertVideo(String videoUrl, String customStyle, String posterUrl) { if (TextUtils.isEmpty(customStyle)) { customStyle = //增加进度控制 // "controls="controls"" + //已修改到video标签里面 //视频显示第一帧 // " initial-time="0.01" " +//客户端无效 //宽高 "height="300" " + //样式 " style="margin-top:10px;max-width:100%;""; }

    if (TextUtils.isEmpty(posterUrl) && isNeedAutoPosterUrl) {
        Bitmap videoThumbnail = getVideoThumbnail(videoUrl);
        if (videoThumbnail != null) {
            String videoThumbnailUrl = FilesUtils.saveBitmap(videoThumbnail);
            if (!TextUtils.isEmpty(videoThumbnailUrl)) {
                posterUrl = videoThumbnailUrl;
            }
        }

    }


    System.out.println("videoUrl = [" + videoUrl + "], custom = [" + customStyle + "]");
    System.out.println("videoUrl getAbsolutePath = [" + new File(videoUrl).getAbsolutePath() + "]");
    exec("javascript:RE.prepareInsert();");
    exec("javascript:RE.insertVideo('" + videoUrl + "', '" + customStyle + "', '" + posterUrl + "');");
}`

RexSuper avatar Mar 05 '20 09:03 RexSuper

public void insertVideo(String videoUrl, String customStyle, String posterUrl) { if (TextUtils.isEmpty(customStyle)) { customStyle = "height="300" " + " style="margin-top:10px;max-width:100%;display:block;width:100%;object-fit: fill;""; }

我也有这个需求 这么改就可以了

zhaozhaopeng68 avatar Jan 27 '21 06:01 zhaozhaopeng68