Answered by:
Fail to load customize video from video tag?

Question
-
Hi,I met a strange problem when I load non-default supported format media in video tag.I create a decoder for decoding mpeg2 file by my self and successful load a mpeg2 file in the Media Plug sample.But when I try to load the video selected by the file picker. It failed to load. I have already using URL.createObjectURL to create the file URL.Does anyone have idea about what happened in my case? (It works when I add the same file into my project and using something like /videos/video.m2v as the video's src.)Thank you~~EricMonday, October 17, 2011 2:23 PM
Answers
-
Eric,
I could get the Media sample to work with the file picker successfully.
Modify your code to use the file picker similar to this:
function localDecoderOpen() {
// Set video element's source
var pick = Windows.Storage.Pickers.FileOpenPicker();
pick.fileTypeFilter.replaceAll(["*"]);
pick.pickSingleFileAsync().then(function (file) {
WinJS.Utilities.query("#localDecoderVideo")[0].src = URL.createObjectURL(file, false);
});
}Let me know if that makes a difference.
-Jeff
Jeff Sanders (MSFT)- Marked as answer by Peng Huan Hung Thursday, October 20, 2011 9:35 AM
Wednesday, October 19, 2011 6:58 PMModerator
All replies
-
Can you successfully load a supported format successfully? Is the problem in your app only the non supported video?
Jeff Sanders (MSFT)Monday, October 17, 2011 2:50 PMModerator -
Yes, supported video can play well when I selected it from file picker. Just non-support format has crash issue.
But non-support format can load successful when I add it into project as the asset.
Is there something can help me to identify what happened?
Eric
Tuesday, October 18, 2011 1:43 AM -
Eric,
I could get the Media sample to work with the file picker successfully.
Modify your code to use the file picker similar to this:
function localDecoderOpen() {
// Set video element's source
var pick = Windows.Storage.Pickers.FileOpenPicker();
pick.fileTypeFilter.replaceAll(["*"]);
pick.pickSingleFileAsync().then(function (file) {
WinJS.Utilities.query("#localDecoderVideo")[0].src = URL.createObjectURL(file, false);
});
}Let me know if that makes a difference.
-Jeff
Jeff Sanders (MSFT)- Marked as answer by Peng Huan Hung Thursday, October 20, 2011 9:35 AM
Wednesday, October 19, 2011 6:58 PMModerator -
Thanks,
Finally I found a strange issue from my case, actually I done like yours.
But I found that if the video tag without "autoplay" property, my app crash when I resize the video tag's size. (I set to 100% 100%)
Every thing work fine after I add autoplay to my video tag.
I am checking why this happened.
Thanks again.
Eric
Thursday, October 20, 2011 9:39 AM -
Hello Eric,
Thank you for the update in your problem. I am very glad you were able to resolve it! Could you tell me what steps I could take in the Media Plugin sample to recreate the crash? I will debug that issue from my end.
Thanks!
-Jeff
Jeff Sanders (MSFT)Thursday, October 20, 2011 11:36 AMModerator -
Hi, Jeff,
I thought this issue may caused by our self, my colleague is checking what happened now. I will update this issue once we got the root cause.
But for my personal case, my media-plug in sample doesn't work on first case. (Install a local decoder.) Others work well on my machine.
the error is
MEDIA_ERR_DECODE, and error code is -1072873851.
I am using Acer Aspire one 752 for the preview build. I think this may cause by the hardware itself.
By the way, I really appreciate your help~~~Eric
Thursday, October 20, 2011 1:10 PM -
Hi Eric,
My pleasure to help however I can. If this is an HTML/jscript app you can try disabling hardware acceleration in IE and see if that solves the issue (don't forget to re-enable it later):
http://support.microsoft.com/kb/2528233
-Jeff
Jeff Sanders (MSFT)Thursday, October 20, 2011 1:17 PMModerator -
Hi Jeff,
Thanks, this help me to resolve this issue~~~~
Eric
Thursday, October 20, 2011 1:43 PM