Exemplo n.º 1
0
    /// <summary>
    /// API:按照指定索引号播放影片,索引号取自外部XML配置
    /// </summary>
    /// <param name="index">影片索引号</param>
    public void ReplayMovieAt(int index)
    {
        if (index < 0 || index > ConfigXML.XMLData["MovieList"].ChildNodes.Count)
        {
            Debug.LogError("影片序号超出边界!");
            return;
        }



        currentMovieIndex = index;

        mvPlayer.m_VideoPath = ConfigXML.AppMediaPath + ConfigXML.XMLData["MovieList"].ChildNodes[index].InnerText;
        //mvSource._colourFormat = AVProWindowsMediaMovie.ColourFormat.RGBA32;
        //mvSource._folder = ConfigXML.AppMediaPath;
        //mvSource._filename = ConfigXML.XMLData["MovieList"].ChildNodes[index].InnerText;
        //bool loaded = mvSource.LoadMovie(true);
        mvPlayer.OpenVideoFromFile(MediaPlayer.FileLocation.RelativeToProjectFolder, ConfigXML.AppMediaPath + ConfigXML.XMLData["MovieList"].ChildNodes[index].InnerText);
        if (mvStartHandler != null)
        {
            mvStartHandler.Invoke(currentMovieIndex);
        }

        KioTools.StopReturnHomeClockStatic();
    }
Exemplo n.º 2
0
 public bool ReplayMovieByURL(string url, string _scaleMode, bool isLoop = false)
 {
     if (!string.IsNullOrEmpty(url) && File.Exists(url))
     {
         //switch (_scaleMode)
         //{
         //    case "stretch":
         //        mvDisplay._scaleMode = ScaleMode.ScaleToFit;
         //        break;
         //    case "proportionalInside":
         //        mvDisplay._scaleMode = ScaleMode.StretchToFill;
         //        break;
         //    case "proportionalOutside":
         //        mvDisplay._scaleMode = ScaleMode.ScaleAndCrop;
         //        break;
         //    default:
         //        mvDisplay._scaleMode = ScaleMode.ScaleToFit;
         //        break;
         //}
         mvPlayer.m_Loop = isLoop;
         mvPlayer.OpenVideoFromFile(MediaPlayer.FileLocation.AbsolutePathOrURL, url);
         if (mvStartHandler != null)
         {
             mvStartHandler.Invoke(currentMovieIndex);
         }
         KioTools.StopReturnHomeClockStatic();
         return(true);
     }
     else
     {
         return(false);
     }
 }