我必须传入Eval("link")
iframe 标签。这eval("link ")
意味着最近在视频库中上传的视频,我只想在 iframe 中显示最近的项目:
<iframe title="YouTube video player" width="525" height="325" src='<%# Eval("link") %>' frameborder="0" ></iframe>
我的代码在这里不能正常工作:
function OpenDialog() {
var options = {
url: '/Shared%20Documents/Forms/AllItems.aspx',
title:Test modal dialogue,
width: 1100,
height: 600,
left: 50,
top: 50,
status: 0,
toolbar: 0,
menubar: 0,
resizable: 1,
dialogReturnValueCallback: CloseCallback
};
SP.UI.ModalDialog.showModalDialog(options);
SP.UI.Modal.OpenPopUpPage('Home.aspx', CloseCallback, 1100, 600);
}
function autoPlayVideo(vcode, width, height) {
"use strict"; $("#videoContainer").html('<iframe width="' + width + '" height="' + height + '" src="https://www.youtube.com/embed/' + vcode + '?autoplay=1&loop=1&rel=0&wmode=transparent" frameborder="0" allowfullscreen wmode="transparent"></iframe>');
}
jQuery('a.introVid').click(function () { autoPlayVideo('Eval("link")', '450', '350'); });
function CloseCallback(result, returnValue) {
alert('Result from dialog was: ' + result);
if (result == SP.UI.DialogResult.Ok) {
alert('You clicked Ok');
}
else if (result == SP.UI.DialogResult.cancel) {
alert('You clicked Cancel');
}
}