[core] GOWS - add seconds to video messages

fix #1893
This commit is contained in:
devlikepro committed 2026-02-18 17:11:11 +07:00
1 parent 607dff8f7a
commit cc47321cad
2 files changed
+297 -1

No files matched your search

+93
View File
@@ -2996,6 +2996,73 @@ export namespace messages {
return AudioInfo.deserialize(bytes);
}
}
export class VideoInfo extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
duration?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("duration" in data && data.duration != undefined) {
this.duration = data.duration;
}
}
}
get duration() {
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
}
set duration(value: number) {
pb_1.Message.setField(this, 1, value);
}
static fromObject(data: {
duration?: number;
}): VideoInfo {
const message = new VideoInfo({});
if (data.duration != null) {
message.duration = data.duration;
}
return message;
}
toObject() {
const data: {
duration?: number;
} = {};
if (this.duration != null) {
data.duration = this.duration;
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.duration != 0)
writer.writeFloat(1, this.duration);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): VideoInfo {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new VideoInfo();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.duration = reader.readFloat();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): VideoInfo {
return VideoInfo.deserialize(bytes);
}
}
export class Media extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
@@ -3005,6 +3072,7 @@ export namespace messages {
audio?: AudioInfo;
filename?: string;
contentPath?: string;
video?: VideoInfo;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@@ -3027,6 +3095,9 @@ export namespace messages {
if ("contentPath" in data && data.contentPath != undefined) {
this.contentPath = data.contentPath;
}
if ("video" in data && data.video != undefined) {
this.video = data.video;
}
}
}
get content() {
@@ -3068,6 +3139,15 @@ export namespace messages {
set contentPath(value: string) {
pb_1.Message.setField(this, 6, value);
}
get video() {
return pb_1.Message.getWrapperField(this, VideoInfo, 7) as VideoInfo;
}
set video(value: VideoInfo) {
pb_1.Message.setWrapperField(this, 7, value);
}
get has_video() {
return pb_1.Message.getField(this, 7) != null;
}
static fromObject(data: {
content?: Uint8Array;
type?: MediaType;
@@ -3075,6 +3155,7 @@ export namespace messages {
audio?: ReturnType<typeof AudioInfo.prototype.toObject>;
filename?: string;
contentPath?: string;
video?: ReturnType<typeof VideoInfo.prototype.toObject>;
}): Media {
const message = new Media({});
if (data.content != null) {
@@ -3095,6 +3176,9 @@ export namespace messages {
if (data.contentPath != null) {
message.contentPath = data.contentPath;
}
if (data.video != null) {
message.video = VideoInfo.fromObject(data.video);
}
return message;
}
toObject() {
@@ -3105,6 +3189,7 @@ export namespace messages {
audio?: ReturnType<typeof AudioInfo.prototype.toObject>;
filename?: string;
contentPath?: string;
video?: ReturnType<typeof VideoInfo.prototype.toObject>;
} = {};
if (this.content != null) {
data.content = this.content;
@@ -3124,6 +3209,9 @@ export namespace messages {
if (this.contentPath != null) {
data.contentPath = this.contentPath;
}
if (this.video != null) {
data.video = this.video.toObject();
}
return data;
}
serialize(): Uint8Array;
@@ -3142,6 +3230,8 @@ export namespace messages {
writer.writeString(5, this.filename);
if (this.contentPath.length)
writer.writeString(6, this.contentPath);
if (this.has_video)
writer.writeMessage(7, this.video, () => this.video.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
@@ -3169,6 +3259,9 @@ export namespace messages {
case 6:
message.contentPath = reader.readString();
break;
case 7:
reader.readMessage(message.video, () => message.video = VideoInfo.deserialize(reader));
break;
default: reader.skipField();
}
}
+204 -1
View File
@@ -120,6 +120,7 @@ goog.exportSymbol('proto.messages.SubscribePresenceRequest', null, global);
goog.exportSymbol('proto.messages.UpdateContactRequest', null, global);
goog.exportSymbol('proto.messages.UpdateParticipantsRequest', null, global);
goog.exportSymbol('proto.messages.UpsertLabelRequest', null, global);
goog.exportSymbol('proto.messages.VideoInfo', null, global);
goog.exportSymbol('proto.messages.vCardContact', null, global);
/**
* Generated by JsPbCodeGenerator.
@@ -772,6 +773,27 @@ if (goog.DEBUG && !COMPILED) {
*/
proto.messages.AudioInfo.displayName = 'proto.messages.AudioInfo';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.messages.VideoInfo = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.messages.VideoInfo, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.messages.VideoInfo.displayName = 'proto.messages.VideoInfo';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
@@ -7698,6 +7720,136 @@ proto.messages.AudioInfo.prototype.setWaveform = function(value) {
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.messages.VideoInfo.prototype.toObject = function(opt_includeInstance) {
return proto.messages.VideoInfo.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.messages.VideoInfo} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.messages.VideoInfo.toObject = function(includeInstance, msg) {
var f, obj = {
duration: jspb.Message.getFloatingPointFieldWithDefault(msg, 1, 0.0)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.messages.VideoInfo}
*/
proto.messages.VideoInfo.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.messages.VideoInfo;
return proto.messages.VideoInfo.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.messages.VideoInfo} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.messages.VideoInfo}
*/
proto.messages.VideoInfo.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {number} */ (reader.readFloat());
msg.setDuration(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.messages.VideoInfo.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.messages.VideoInfo.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.messages.VideoInfo} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.messages.VideoInfo.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getDuration();
if (f !== 0.0) {
writer.writeFloat(
1,
f
);
}
};
/**
* optional float duration = 1;
* @return {number}
*/
proto.messages.VideoInfo.prototype.getDuration = function() {
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0));
};
/**
* @param {number} value
* @return {!proto.messages.VideoInfo} returns this
*/
proto.messages.VideoInfo.prototype.setDuration = function(value) {
return jspb.Message.setProto3FloatField(this, 1, value);
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
@@ -7732,7 +7884,8 @@ proto.messages.Media.toObject = function(includeInstance, msg) {
mimetype: jspb.Message.getFieldWithDefault(msg, 3, ""),
audio: (f = msg.getAudio()) && proto.messages.AudioInfo.toObject(includeInstance, f),
filename: jspb.Message.getFieldWithDefault(msg, 5, ""),
contentpath: jspb.Message.getFieldWithDefault(msg, 6, "")
contentpath: jspb.Message.getFieldWithDefault(msg, 6, ""),
video: (f = msg.getVideo()) && proto.messages.VideoInfo.toObject(includeInstance, f)
};
if (includeInstance) {
@@ -7794,6 +7947,11 @@ proto.messages.Media.deserializeBinaryFromReader = function(msg, reader) {
var value = /** @type {string} */ (reader.readString());
msg.setContentpath(value);
break;
case 7:
var value = new proto.messages.VideoInfo;
reader.readMessage(value,proto.messages.VideoInfo.deserializeBinaryFromReader);
msg.setVideo(value);
break;
default:
reader.skipField();
break;
@@ -7866,6 +8024,14 @@ proto.messages.Media.serializeBinaryToWriter = function(message, writer) {
f
);
}
f = message.getVideo();
if (f != null) {
writer.writeMessage(
7,
f,
proto.messages.VideoInfo.serializeBinaryToWriter
);
}
};
@@ -8020,6 +8186,43 @@ proto.messages.Media.prototype.setContentpath = function(value) {
};
/**
* optional VideoInfo video = 7;
* @return {?proto.messages.VideoInfo}
*/
proto.messages.Media.prototype.getVideo = function() {
return /** @type{?proto.messages.VideoInfo} */ (
jspb.Message.getWrapperField(this, proto.messages.VideoInfo, 7));
};
/**
* @param {?proto.messages.VideoInfo|undefined} value
* @return {!proto.messages.Media} returns this
*/
proto.messages.Media.prototype.setVideo = function(value) {
return jspb.Message.setWrapperField(this, 7, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.messages.Media} returns this
*/
proto.messages.Media.prototype.clearVideo = function() {
return this.setVideo(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.messages.Media.prototype.hasVideo = function() {
return jspb.Message.getField(this, 7) != null;
};