protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            mHodClient.onErrorOccurred             += HodClient_onErrorOccurred;
            mHodClient.requestCompletedWithContent += HodClient_requestCompletedWithContent;
            mHodClient.requestCompletedWithJobID   += HodClient_requestCompletedWithJobID;

            mTimer       = new DispatcherTimer();
            mTimer.Tick += Timer_Tick;
            mplayer.CurrentStateChanged += Mplayer_CurrentStateChanged;

            mDelayTimer                          = new DispatcherTimer();
            mDelayTimer.Tick                    += DelayTimer_Tick;
            mDelayTimer.Interval                 = TimeSpan.FromMilliseconds(100);
            runningText.DataContext              = mTextItem;
            processedcontent.NavigationStarting += Processedcontent_NavigationStarting;

            mDelayTextChangedTimer          = new DispatcherTimer();
            mDelayTextChangedTimer.Tick    += DelayTextChangedTimer_Tick;
            mDelayTextChangedTimer.Interval = TimeSpan.FromMilliseconds(1500);

            operation.Text = "Reading media content.";
            loadingindicator.Visibility = Visibility.Visible;
            mIsReading = true;
            ContentModel item = (ContentModel)e.Parameter;

            mHodApp = HODApps.GET_CONTENT;
            var Params = new Dictionary <string, object>();

            Params.Add("index_reference", item.reference);
            Params.Add("indexes", item.index);
            if (mPunctuation == true)
            {
                Params.Add("print_fields", "offset,text,concepts,occurrences,language");
            }
            else
            {
                Params.Add("print_fields", "offset,text,content,concepts,occurrences,language");
            }

            mHodClient.GetRequest(ref Params, mHodApp, HODClient.REQ_MODE.SYNC);
            mIndex               = 0;
            mReadText            = "";
            mTextItem.ReadText   = "";
            mTextItem.Word       = "";
            mTextItem.UnreadText = "";

            mEeResponse = null;
            mSaResponse = null;

            conceptbtn.IsEnabled    = true;
            sentimentbtn.IsEnabled  = true;
            entitybtn.IsEnabled     = true;
            transcriptbtn.IsEnabled = false;
            nextwordbtn.IsEnabled   = false;
            searchwordcount.Text    = "";
            string content     = App.mRemoteServer + item.filename;
            Uri    contentLink = new Uri(content, UriKind.RelativeOrAbsolute);

            mplayer.Source = contentLink;
        }
        async private void HodClient_requestCompletedWithContent(string response)
        {
            await messageDispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                mJobID               = "";
                String text          = "";
                indicator.Visibility = Visibility.Collapsed;
                if (mHodApp == HODApps.GET_CONTENT)
                {
                    mContentResponse = (GetContentResponse)mParser.ParseCustomResponse <GetContentResponse>(ref response);
                    if (mContentResponse != null)
                    {
                        // purify word array
                        if (mPunctuation == true)
                        {
                            var words     = mContentResponse.documents[0].text;
                            var timestamp = mContentResponse.documents[0].offset;

                            int count = mContentResponse.documents[0].text.Count;
                            int start = (mContentResponse.documents[0].text.Count > 10) ? 10 : 0;
                            int end   = (mContentResponse.documents[0].text.Count > 200) ? 150 : mContentResponse.documents[0].text.Count;
                            var total = 0.0;
                            for (int i = start; i < end; i++)
                            {
                                total += timestamp[i] - timestamp[i - 1];
                            }
                            var average   = total / end - 1;
                            double para   = average + 1500;
                            double dot    = average + 800;
                            double commas = average + 400;
                            count         = words.Count;
                            words[0]      = FirstCharToUpper(words[0]);
                            var len       = 0;
                            for (int i = 1; i < count; i++)
                            {
                                if (!words[i].Equals("<Music/Noise>") && !words[i - 1].Equals("<Music/Noise>"))
                                {
                                    var diff = timestamp[i] - timestamp[i - 1];
                                    if (diff > para && len > 1) // 2000
                                    {
                                        words[i - 1] += ".\n";
                                        words[i]      = FirstCharToUpper(words[i]);
                                        len           = 0;
                                    }
                                    else if (diff > dot && len > 1) // 1500
                                    {
                                        words[i - 1] += ".";
                                        words[i]      = FirstCharToUpper(words[i]);
                                        len           = 0;
                                    }
                                    else if (diff > commas && len > 1) // 1000
                                    {
                                        words[i - 1] += ",";
                                        len           = 0;
                                    }
                                    else
                                    {
                                        len++;
                                    }
                                }
                            }
                            mContentResponse.documents[0].text    = words;
                            mContentResponse.documents[0].offset  = timestamp;
                            mContentResponse.documents[0].content = String.Join(" ", words);

                            mTextItem.UnreadText = mContentResponse.documents[0].content;
                            mIsReading           = false;
                            if (mplayer.CurrentState != MediaElementState.Playing)
                            {
                                mplayer.Play();
                            }
                        }
                        else
                        {
                            mTextItem.UnreadText += mContentResponse.documents[0].content;
                        }
                        mIndex = 0;
                    }
                }
                else if (mHodApp == HODApps.FIND_SIMILAR)
                {
                    var result = (FindSimilarResponse)mParser.ParseCustomResponse <FindSimilarResponse>(ref response);
                    if (result != null)
                    {
                        text = "<html><head/><body><div style=\"font-size:1.0em\">";
                        mUrlList.Clear();
                        text += "<div style=\"text-align:right\"><a href=\"hod_home\">Back to Concepts</a></div>";
                        foreach (var document in result.documents)
                        {
                            text += String.Format("<div><b>Title: </b>{0} </div>", document.title);
                            text += String.Format("<div><b>Relevance: </b>{0}%</div>", document.weight.ToString("0.00"));
                            if (document.summary != null)
                            {
                                text += String.Format("<div><b>Summary: </b>{0}</div>", document.summary);
                            }
                            if (document.reference != null)
                            {
                                text += String.Format("<div><b>Content: </b><a href=\"{0}\">website</a></div>", document.reference);
                                mUrlList.Add(document.reference);
                            }
                            text += "</br>";
                        }
                        text += "</div></body></html>";
                        processedcontent.NavigateToString(text);
                    }
                }
                else if (mHodApp == HODApps.QUERY_TEXT_INDEX)
                {
                    mInprogress = false;
                    mMediaList  = (QueryTextIndexResponse)mParser.ParseCustomResponse <QueryTextIndexResponse>(ref response);
                    if (mMediaList != null)
                    {
                        mListViewModel.ClearData();
                        foreach (QueryTextIndexResponse.Document doc in mMediaList.documents)
                        {
                            ContentModel item = new ContentModel();
                            item.Type         = doc.mediatype[0];
                            item.Title        = doc.medianame[0];
                            if (doc.filename != null)
                            {
                                item.filename = doc.filename[0];
                            }
                            item.reference = doc.reference;
                            item.index     = doc.index;

                            var type = item.Type.Split('/');
                            if (type[0] == "video")
                            {
                                item.Icon = "Assets/video_icon.png";
                            }
                            else
                            {
                                item.Icon = "Assets/audio_icon.png";
                            }

                            mListViewModel.Items.Add(item);
                        }
                    }
                }
                else if (mHodApp == HODApps.ANALYZE_SENTIMENT)
                {
                    mSaResponse = mParser.ParseSentimentAnalysisResponse(ref response);
                    if (mSaResponse != null)
                    {
                        parseSentimentAnalysis();
                    }
                }
                else if (mHodApp == HODApps.ENTITY_EXTRACTION)
                {
                    mEeResponse = (EntityExtractionResponse)mParser.ParseCustomResponse <EntityExtractionResponse>(ref response);
                    if (mEeResponse != null)
                    {
                        parseEntityExtraction();
                    }
                    else
                    {
                        text += "Error!</div></body></html>";
                        processedcontent.NavigateToString(text);
                    }
                }
            });
        }