我想让 Facebook 分享对话框的工作方式是,当用户分享网页时,它会作为视频出现在时间轴中,当点击视频时,它会展开为嵌入的 iframe(就像您分享网页时发生的情况一样)优酷视频)。
开放图元标记:
<meta property="fb:app_id" content="blahblah" />
<meta property="og:title" content="LSK Building" />
<meta property="og:url" content="https://www.example.com/video/some_id" />
<meta property="og:image" content="https://www.example.com/image/some_id/thumbnail.JPG" />
<meta property="og:site_name" content="My site" />
<meta property="og:type" content="video" />
<meta property="og:video:type" content="text/html" />
<meta property="og:video:url" content="https://www.example.com/video/some_id/embed" />
<meta property="og:video:secure_url" content="https://www.example.com/video/some_id/embed" />
<meta property="og:video:width" content="800" />
<meta property="og:video:height" content="600" />
分享对话框:
window.open('https://www.facebook.com/dialog/share' +
'?app_id=' + facebook_app_id +
'&href=' + dlink +
'&display=popup' +
'&redirect_uri=' + origin
, ''
, 'width=0, height=0');
共享时它会正确显示(作为视频),但是当我在时间轴中单击视频时,它会直接变成视频元素,而不是 iframe。我错过了什么?