Click here to Skip to main content
11,935,361 members (60,989 online)
Click here to Skip to main content


79 bookmarked

Kinect Reception

, 12 Jan 2012 Ms-PL
TV Screen in the Reception, When nothing happens (no one is in the reception) we can display videos on the screen but when someone enters the frame show him the Kinect Image, and if the user is doing something funny, capture his image and save it.
// Written by Shai Raiten:

using System;
using System.Collections;
using System.IO;
using KinectReception.Enums;

namespace KinectReception.Managers
    public static class VideoManager
        /// <summary>
        /// Define the type of video you want to play
        /// If you ask for out video and there isn't one return null - Stop Video and
        ///         start showing Kinect Image
        /// If you ask for in video and there isn't one then return random video.
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
public static Uri GetVideo(VideoType type)
    if (string.IsNullOrEmpty(Properties.Settings.Default.VideosLibraryFolder) ||
        return null;
        string value = null;
        switch (type)
            case VideoType.In:
                value = Properties.Settings.Default.VideosLibraryInFile;
                return string.IsNullOrEmpty(value) || !File.Exists(value) ?
                    CollectRandomMovie() : new Uri(value);
            case VideoType.Out:
                value = Properties.Settings.Default.VideosLibraryOutFile;
                return string.IsNullOrEmpty(value) || !File.Exists(value) ?
                    null : new Uri(value);
                return CollectRandomMovie();

private static Uri CollectRandomMovie()
    var movies = new ArrayList();

    foreach (var filter in Properties.Settings.Default.VideoFilter)

    if (movies.Count == 0) return null;

    var rnd = new Random();
    return new Uri(movies[rnd.Next(movies.Count)].ToString());

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


About the Author

Shai Raiten
Architect Sela
Israel Israel
Shai Raiten is VS ALM MVP, currently working for Sela Group as a ALM senior consultant and trainer specializes in Microsoft technologies especially Team System and .NET technology. He is currently consulting in various enterprises in Israel, planning and analysis Load and performance problems using Team System, building Team System customizations and adjusts ALM processes for enterprises. Shai is known as one of the top Team System experts in Israel. He conducts lectures and workshops for developers\QA and enterprises who want to specialize in Team System.

My Blog:

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.151126.1 | Last Updated 12 Jan 2012
Article Copyright 2011 by Shai Raiten
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid