【问题标题】:Vimeo js API load videoVimeo js API 加载视频
【发布时间】:2016-12-07 15:22:05
【问题描述】:

我正在播放器中加载一个新的 vimeo id 选项。 视频已加载并可在播放器内播放,但未使用选项(肖像、标题、..)。

这是用于创建播放器的代码(准备就绪)

var iframe = $('#vimeoContainer');
var options = {
    id : 191611447,
    portrait: 0,
    title : 0,
    byline: 0,
};

var player = new Vimeo.Player(iframe, options);

这是在此播放器中加载视频的代码

  player.loadVideo(sl).then(function(id) {
// the video successfully loaded
}).catch(function(error) {
switch (error.name) {
    case 'TypeError':
        // the id was not a number
        break;

    case 'PasswordError':
        // the video is password-protected and the viewer needs to enter the
        // password first
        break;

    case 'PrivacyError':
        // the video is password-protected or private
        break;

    default:
        // some other error occurred
        break;
}
});

感谢您的帮助和时间

【问题讨论】:

  • 您将标题和署名设置为 0 (false),因此标题和署名不会显示,您会得到您所要求的形式。要解决此问题,请不要设置选项(删除它)或将其设置为 1。更多信息:developer.vimeo.com/player/sdk/embed

标签: javascript jquery vimeo-api vimeo-player


【解决方案1】:

您将标题和署名设置为 0 (false),因此标题和署名不会显示,您会得到您想要的。要解决此问题,请不要设置选项(删除它)或将其设置为 1/true。

var options = {
    id : 191611447,
    portrait: 0,
    title : true, // its the default anyway
    byline: true, // its the default anyway
};

或:

var options = {
    id : 191611447,
    portrait: 0,
};

更多信息:https://developer.vimeo.com/player/sdk/embed

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-10-10
    • 2013-03-17
    • 1970-01-01
    • 1970-01-01
    • 2015-11-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多