为了账号安全,请及时绑定邮箱和手机立即绑定

为什么这个 webm 不播放?

为什么这个 webm 不播放?

Smart猫小萌 2023-01-06 16:09:14
我很困惑,因为 webm 没有正确显示。但是当我将代码更改为最低限度时,<video controls><source src="http://i.imgur.com/91S22q6.webm" type="video/webm" codecs="vp8, vorbis" style="width: 100%; height: auto;></video>它就可以工作了……那么我的完整代码是怎么回事,webm 不起作用?https://jsfiddle.net/2buqa04d/HTML<div class = "entry-body">  <div class = "entry-title">    <a href="http://i.imgur.com/91S22q6.webm">Title</a>  </div>  <div class= "entry-byline">    by John Smith  </div></div>JS$('.entry-body').each(function() {var hplink = ($(this).find('.entry-title').find("a").prop('href'));                        if (hplink.toLowerCase().match(/\.(webm)/g)) {                                                                                   $(this).find('.entry-byline').after('<div class="beforeembed"></div><div class="hpembed hpembedMW"><video controls><source src="'+hplink+'" type="video/webm" codecs="vp8, vorbis" style="width: 100%; height: auto;></video></div>');                        }            alert(hplink);});
查看完整描述

1 回答

?
杨__羊羊

TA贡献1943条经验 获得超7个赞

代码缺少一个"接近尾声


$('.entry-body').each(function() {


var hplink = ($(this).find('.entry-title').find("a").prop('href'));


                        if (hplink.toLowerCase().match(/\.(webm)/g)) { 

                            

              

                            

            $(this).find('.entry-byline').after('<div class="beforeembed"></div><div class="hpembed hpembedMW"><video controls><source src="'+hplink+'" type="video/webm" codecs="vp8, vorbis" style="width: 100%; height: auto;"></video></div>');


                        }

            

alert(hplink);


});

在“高度:自动;”之后


查看完整回答
反对 回复 2023-01-06
  • 1 回答
  • 0 关注
  • 216 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号