package com.sheep.gamegroup.model.entity;

import java.io.Serializable;

import cn.finalteam.rxgalleryfinal.bean.MediaBean;

/**
 * Created by realicing on 2018/11/30.
 * realicing@sina.com
 * 视频数据
 */
public class Video implements Serializable {

    private int width;//视频宽
    private int height;//视频高
    private long duration;//视频长度，单位毫秒
    private String filePath;//文件对应地址
    private int topicId;//选择的话题的id

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public long getDuration() {
        return duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }

    public int getTopicId() {
        return topicId;
    }

    public void setTopicId(int topicId) {
        this.topicId = topicId;
    }


    //通过MediaBean获取Video
    public static Video from(MediaBean item) {
        Video video = new Video();
        video.setWidth(item.getWidth());
        video.setHeight(item.getHeight());
        video.setDuration(item.getDuration());
        video.setFilePath(item.getOriginalPath());
        return video;
    }
}
