private void SetPrimaryAssetFile()
        {
            IEncoderSupport myEncodigSupport = new EncoderSupport(_MediaServicesContext);
            IAssetFile      mp4 = myAssetOriginal.AssetFiles.Where(f => f.Name.ToLower().EndsWith(".mp4")).FirstOrDefault();

            myEncodigSupport.SetPrimaryFile(myAssetOriginal, mp4);
        }
Example #2
0
        /// <summary>
        /// Set MP4 as primary file
        /// </summary>
        private void setPrimaryFile()
        {
            string     myPrimaryFile = null;
            IAssetFile mp4           = null;


            if (!string.IsNullOrEmpty(myRequest.ButlerRequest.ControlFileUri))
            {
                //
                IButlerStorageManager resource = BlobManagerFactory.CreateBlobManager(myRequest.ProcessConfigConn);
                string jsonControl             = resource.ReadTextBlob(new Uri(myRequest.ButlerRequest.ControlFileUri));
                if (!string.IsNullOrEmpty(jsonControl))
                {
                    IjsonKeyValue myControl = new jsonKeyValue(jsonControl);
                    myPrimaryFile = myControl.Read(DotControlConfigKeys.IngestMultiMezzamineFilesPrimaryFile);
                }
            }

            IEncoderSupport myEncodigSupport = new EncoderSupport(MediaContext);

            if (!string.IsNullOrEmpty(myPrimaryFile))
            {
                mp4 = currentAsset.AssetFiles.Where(f => f.Name.ToLower() == myPrimaryFile.ToLower()).FirstOrDefault();
            }
            if (mp4 == null)
            {
                mp4 = currentAsset.AssetFiles.Where(f => f.Name.ToLower().EndsWith(".mp4")).FirstOrDefault();
            }
            if (mp4 != null)
            {
                myEncodigSupport.SetPrimaryFile(currentAsset, mp4);
            }
            else
            {
                Trace.TraceWarning("{0} setPrimaryFile {2} processId {1}, has not MP4 file", this.GetType().FullName, myRequest.ProcessInstanceId, myRequest.ProcessTypeId);
            }
        }
 private void SetPrimaryAssetFile()
 {
     IEncoderSupport myEncodigSupport = new EncoderSupport(_MediaServicesContext);
     IAssetFile mp4 = myAssetOriginal.AssetFiles.Where(f => f.Name.ToLower().EndsWith(".mp4")).FirstOrDefault();
     myEncodigSupport.SetPrimaryFile(myAssetOriginal, mp4);
 }