| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- /*
- * Copyright (c) 2023 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- import { image } from '@kit.ImageKit';
- import { FileUtil, StrUtil } from '@pura/harmony-utils';
- import { CommonConstants } from '../common/constants/CommonConstants';
- @Observed
- export class VideoItem {
- id: string;
- name: string;//视频和音频文件名称,音频如果是音乐取歌曲名称值
- filePath: string
- type:number
- videoSize:number;
- cTime:string;//创建时间
- parentPath:string;
- isFav:number;
- pixelMap?: image.PixelMap;
- size?:string;
- pixelMapPath?: string;
- artist?: string;
- album?: string;
- fileName?: string;//音乐文件的真实文件名称
- lastPlayed?:Date;
- duration?:string//时长
- mimeType?:string//类型
- sampleRate?:string//音频的采样率单位为Hz
- trackCount?:string//轨道数量
- lastPlayedStr?:string;//最后播放时间
- playCount?:number//播放次数
- lyricContent?:string//歌词内容
- md5Str?:string//直接用来保存音质的判断
- extra_json?:string
- pyStr?:string//中文歌曲名称拼音的首字母
- bit_rate?:string//比特率
- probe_score?:number//评分
- year?:string//年份
- nb_streams?:number//流数量
- nb_programs?:number//节目数量
- constructor(name: string, id: string, filePath: string, type:number,videoSize:number,cTime: string,pixelMap?: image.PixelMap,
- size?: string,pixelMapPath?: string,artist?: string,album?: string,fileName?: string, lastPlayed?:Date) {
- this.name = name;
- this.id = id;
- this.filePath = filePath;
- this.type = type;
- this.videoSize = videoSize;
- this.cTime = cTime;
- if(StrUtil.isNotEmpty(this.filePath)&&this.type===CommonConstants.TYPE_LOCAL){
- try {
- this.parentPath = FileUtil.getParentPath(this.filePath);
- }catch (e) {
- this.parentPath=''
- }
- }else{
- this.parentPath = ''
- }
- this.isFav = 0;
- this.pixelMap = pixelMap;
- this.size = size;
- this.pixelMapPath = pixelMapPath;
- this.artist = artist;
- this.album = album;
- this.fileName = fileName;
- this.lastPlayed = lastPlayed;
- this.playCount = 0
- this.md5Str = ''
- this.extra_json = ''
- this.pyStr = ''
- }
- }
|