关于flipview中的playto功能的问题 [英] A question about playto feature in a flipview
问题描述
你好,
我已经使用flipview启用了playto功能并且它可以工作。
I have enable playto feature with a flipview and it works.
但是接收器总是显示第一页当我改变flipview的页面时不要渲染。
but the receiver always show the first page and do not render when i change the flipview's page.
以下是我的代码部分。
如何让playto接收器渲染图片为flipview的更改页面,谢谢。
how to let the playto receiver render pictures as the flipview's changing page, thanks.
/// --- HTML
///--- HTML
< div class =" FlipViewOutput">
<div class="FlipViewOutput">
< div类= QUOT; FlipItemTemplate"数据双赢控制= QUOT; WinJS.Binding.Template" style =" display:none">
<div class="FlipItemTemplate" data-win-control="WinJS.Binding.Template" style="display: none">
< div class =" overlaidItemTemplate">
<div class="overlaidItemTemplate">
< img class =" flipviewTemplateImage " data-win-bind =" src:source" data-win-bind =" alt:title" />
<img class="flipviewTemplateImage" data-win-bind="src: source" data-win-bind="alt: title" />
< / div>
</div>
< / div>
</div>
< div id =" ;的 myFlipView 强>"类= QUOT; flipView" data-win-control =" WinJS.UI.FlipView">
<div id="myFlipView" class="flipView" data-win-control="WinJS.UI.FlipView">
< / div>
</div>
/// - JS文件
///-- JS file
...
var mediaElement = document.querySelector( '。 flipviewTemplateImage ');
var mediaElement = document.querySelector('.flipviewTemplateImage');
var sr = e.sourceRequest;
var sr = e.sourceRequest;
var deferral = sr.getDeferral();
var deferral = sr.getDeferral();
var controller = mediaElement.msPlayToSource;
var controller = mediaElement.msPlayToSource;
sr.setSource(controller);
sr.setSource(controller);
deferral.complete();
deferral.complete();
推荐答案
不要使用playto。 只需设置图像src。
Do not use playto. Simply set the image src.
您是否尝试过样本?
http://code.msdn.microsoft.com/windowsapps/FlipView-Control-f9d9a99c
为什么这不适合你吗? 你为什么要使用msPlayToSource?
Why would this not work for you? Why are you trying to use msPlayToSource?
-Jeff
这篇关于关于flipview中的playto功能的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!