TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
candidate interview
NA
13
665
Saving video to azure, unable to load video some times
Dec 15 2017 6:49 AM
Hello all I am having the following code to save video to azure, which is working fine. But when I am loading the videos and trying to play them I am unable to play some of them. I am calling this using a service to execute for every 2 seconds to record the video from the angular service
public
async Task<
int
> Save(System.IO.Stream stream,
string
name)
{
MemoryStream memStream =
new
MemoryStream();
stream.CopyTo(memStream);
memStream.Position = 0;
// Parse the connection string and return a reference to the storage account.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(AzureConfig.CONNECTION_STRING);
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
ServiceProperties serviceProperties = await blobClient.GetServicePropertiesAsync();
// Set the default service version to be used for anonymous requests.
serviceProperties.DefaultServiceVersion =
"2016-05-31"
;
// Set the service properties.
await blobClient.SetServicePropertiesAsync(serviceProperties);
// Retrieve a reference to a container.
CloudBlobContainer container = blobClient.GetContainerReference(
"video"
);
// Retrieve reference to a blob named "myblob".
CloudAppendBlob appBlob = container.GetAppendBlobReference(name +
".webm"
);
if
(!await appBlob.ExistsAsync())
{
await appBlob.CreateOrReplaceAsync();
}
appBlob.Properties.ContentType =
"video/webm;codecs=vp9"
;
await appBlob.SetPropertiesAsync();
appBlob.Metadata.Add(
new
KeyValuePair<
string
,
string
>(
"uploadedDate"
, DateTime.Now.ToString()));
await appBlob.AppendFromStreamAsync(memStream);
return
0;
}
The video is getting uploaded but when I am trying to view the video some times the video is not getting displayed. I am using similar kind of this where for every 2 seconds I am calling a service to save the video in to azure
https://www.webrtc-experiment.com/RecordRTC/
Reply
Answers (
1
)
Angular JS App to be tested with Javascript
build a model dialog