【发布时间】:2012-07-20 21:51:42
【问题描述】:
在我的页面上,我有一个 YouTube 视频的缩略图作为图片,我想在用户点击图片后使用 prettyPhoto 播放视频。我怎样才能做到这一点?
这是我的图片代码:
<div class="video" id="videoPlaceHolder" style="position:relative;">
<a rel="prettyPhotos" href="https://www.youtube.com/embed/<?php getFirstFeatureVideoURL(); ?>">
<img style="background:url(<?php getFirstFeatureVideoThumbnail() ?>); background-repeat:no-repeat; background-size:cover; -moz-background-size: cover;" src="/images/ytIndex_overlay.png" onClick="addPlayer();" />
</a>
</div>
php 函数getFirstFeatureVideoURL 抓取并返回第一个视频的“正确”URL(我已经单独检查过,视频播放没有任何问题)。另一个名为getFirstFeatureVideoThumbnail 的函数返回视频的缩略图。我已经为prettyPhoto 准备好了所有插件,到目前为止,它可以完美地处理所有图像。但是,当我尝试通过单击图像来播放此视频时,它给了我错误:
Image cannot be loaded. Make sure the path is correct and the image exists
为什么会出现这个错误?
【问题讨论】:
标签: video youtube xhtml-1.0-strict prettyphoto