从 vimeo 播放器中删除 ui 个元素
Removing ui elements from vimeo player
我想创建一个简单的播放器并从 vimeo 播放器中删除一些 ui 元素,但无论我尝试什么都不起作用...
我有这个代码来加载数据。在“videoUrl”我设置了参数,但没有效果
但根据他们的纪录片,它应该去
https://help.vimeo.com/hc/en-us/articles/360001494447-Using-Player-Parameters
<template>
// <img :src="data.thumbnail_url" alt="" @click="startVideo"/>
<div v-html="data.html" />
</template>
<script>
mounted() {
const videoUrl = `https://player.vimeo.com/video/${this.video_id}?
title=0&
byline=0&
portrait=0`
const requestUrl = `https://vimeo.com/api/oembed.json?url=${videoUrl}`
this.$axios.get(requestUrl).then((response) => {
this.data = response.data
// I also tried to create the iFrame by myself and set the params again in the src but also without any effect.
this.createIframe()
})
},
</script>
createIframe () {
const el_iframe = document.createElement('iframe')
el_iframe.setAttribute('src', `
https://player.vimeo.com/video/${this.video_id}?
title=0&
byline=0&
portrait=0
`)
}
this.$el.appendChild(el_iframe)
}
我还升级到 Pro 帐户,以防其中一些自定义只能在该计划中使用。
我错过了什么?
要设置此属性,视频所有者必须选中此切换按钮
如果你喜欢用列表的方式来写属性,&符号必须在属性前面,问号和video-id在同一行
this.el_iframe.setAttribute('src',
`https://player.vimeo.com/video/${this.video_id}?
title=0
&byline=0
&portrait=0
`)
我想创建一个简单的播放器并从 vimeo 播放器中删除一些 ui 元素,但无论我尝试什么都不起作用...
我有这个代码来加载数据。在“videoUrl”我设置了参数,但没有效果
但根据他们的纪录片,它应该去 https://help.vimeo.com/hc/en-us/articles/360001494447-Using-Player-Parameters
<template>
// <img :src="data.thumbnail_url" alt="" @click="startVideo"/>
<div v-html="data.html" />
</template>
<script>
mounted() {
const videoUrl = `https://player.vimeo.com/video/${this.video_id}?
title=0&
byline=0&
portrait=0`
const requestUrl = `https://vimeo.com/api/oembed.json?url=${videoUrl}`
this.$axios.get(requestUrl).then((response) => {
this.data = response.data
// I also tried to create the iFrame by myself and set the params again in the src but also without any effect.
this.createIframe()
})
},
</script>
createIframe () {
const el_iframe = document.createElement('iframe')
el_iframe.setAttribute('src', `
https://player.vimeo.com/video/${this.video_id}?
title=0&
byline=0&
portrait=0
`)
}
this.$el.appendChild(el_iframe)
}
我还升级到 Pro 帐户,以防其中一些自定义只能在该计划中使用。
我错过了什么?
要设置此属性,视频所有者必须选中此切换按钮
如果你喜欢用列表的方式来写属性,&符号必须在属性前面,问号和video-id在同一行
this.el_iframe.setAttribute('src',
`https://player.vimeo.com/video/${this.video_id}?
title=0
&byline=0
&portrait=0
`)