简体   繁体   中英

Take snapshot from a url based video file in a Javascript Metro Application

I've a few video files urls that my application plays, using the html video tag.

I would like to shows tiles of those videos with an snapshot/thumbnail of it. I've been looking at the Windows.Media.Capture.MediaCapture class and it seems it doesn't support urls.

How can I do this?.

Thanks.

Edit the getThumbnailAsync parameters as needed to get what you want.

var openPicker = new Windows.Storage.Pickers.FileOpenPicker();
openPicker.pickSingleFileAsync().then(function (storageFile) {
    if (storageFile) {

        storageFile.getThumbnailAsync(
            Windows.Storage.FileProperties.ThumbnailMode.musicView,
            100,
            Windows.Storage.FileProperties.ThumbnailOptions.useCurrentScale).then(
                function (storageItemThumbnail) {
                // Add code to process thumbnail
                });

    } else {
        // No file
    }
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM