I am pretty new with Razor Mediator and of course having some issues while testing my TBBs. I am writing a TBB that renders HTML for HTML5 videos like this.
<h2>@Fields.title</h2>
<Video id="@Component.ID" height="@Metadata.height" width="@Metadata.width" poster="@Fields.poster" controls="@Metadata.controls" preload="@Metadata.preload">
@foreach (var source in Fields.sources) {
var mimetype = @source.TridionObject.BinaryContent.MultimediaType.MimeType;
<source type="@mimetype" src="@source" />
}
</Video>
This code generates the following output.
<h2>Video Player Fitted For Sidebar Page</h2>
<Video id="tcm:5-172" height="287" width="510" poster="tcm:5-50" controls="controls" preload="auto">
<source type="video/mp4" src="tcm:5-51" tridion:href="tcm:5-51" tridion:type="Multimedia" tridion:targetattribute="src" />
<source type="video/webm" src="tcm:5-53" tridion:href="tcm:5-53" tridion:type="Multimedia" tridion:targetattribute="src" />
<source type="video/ogg" src="tcm:5-52" tridion:href="tcm:5-52" tridion:type="Multimedia" tridion:targetattribute="src" />
<source type="application/x-shockwave-flash" src="tcm:5-145" tridion:href="tcm:5-145" tridion:type="Multimedia" tridion:targetattribute="src" />
</Video>
The output seems to be all good. but when I try to use the standard LinkResolver TBB, this is the output I get.
<h2>Video Player Fitted For Sidebar Page</h2>
<Video id="tcm:5-172" height="287" width="510" poster="tcm:5-50" controls="controls" preload="auto">
<source src="tcm:0-0-0" type="video/mp4" />
<source src="tcm:0-0-0" type="video/webm" />
<source src="tcm:0-0-0" type="video/ogg" />
<source src="tcm:0-0-0" type="application/x-shockwave-flash" />
</Video>
Any advice?, Should I create my own Link Resolver?
Thank you. Eric.