dev_video
杨树林 5 years ago
parent be852d200b
commit 5ed217d5b5

@ -1,5 +1,5 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { WordsBtn,ActionBtn,getmyUrl } from 'educoder'; import { WordsBtn,ActionBtn,getmyUrl,getUrl } from 'educoder';
import {Tooltip,message,Input, Button} from 'antd'; import {Tooltip,message,Input, Button} from 'antd';
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import axios from 'axios' import axios from 'axios'
@ -60,7 +60,8 @@ class Fileslistitem extends Component{
if(list.content_type==="video/mp4"){ if(list.content_type==="video/mp4"){
this.setState({ this.setState({
videoModalObj:true, videoModalObj:true,
file_url:"https://"+document.domain+list.url+'?file_name='+list.title, // file_url:"https://"+document.domain+list.url+'?file_name='+list.title+"&disposition=MP4",
file_url:getUrl()+list.url+'?file_name='+list.title+'&disposition=MP4',
}) })
return return
}else{ }else{
@ -92,7 +93,9 @@ class Fileslistitem extends Component{
if(list.content_type==="video/mp4"){ if(list.content_type==="video/mp4"){
this.setState({ this.setState({
videoModalObj:true, videoModalObj:true,
file_url:"https://"+document.domain+list.url+'?file_name='+list.title, // file_url:"https://"+document.domain+list.url+'?file_name='+list.title+'&disposition=MP4',
file_url:getUrl()+list.url+'?file_name='+list.title+'&disposition=MP4',
}) })
return return
}else{ }else{
@ -126,10 +129,11 @@ class Fileslistitem extends Component{
} }
Clicktobroadcastthevideo=(bool,url)=>{ Clicktobroadcastthevideo=(bool,url)=>{
this.setState({ this.setState({
videoModalObj:bool, videoModalObj:bool,
file_url:"https://"+document.domain+url, // file_url:"https://"+document.domain+url+'&disposition=MP4',
}) file_url:getUrl()+url+'&disposition=MP4',
})
} }
@ -231,8 +235,8 @@ class Fileslistitem extends Component{
width={800 - 1} width={800 - 1}
> >
<video <video
autoplay="true" preload="auto"
src={file_url} controls="true" controlslist="nodownload"> src={file_url} controls="true" >
您的浏览器不支持 video 标签 您的浏览器不支持 video 标签
</video> </video>
<div className="df copyLine"> <div className="df copyLine">
@ -259,7 +263,7 @@ class Fileslistitem extends Component{
{...this.props} {...this.props}
visible={this.state.Showoldfiles} visible={this.state.Showoldfiles}
allfiles={this.state.allfiles} allfiles={this.state.allfiles}
Clicktobroadcastthevideo={(bool,urls)=>this.Clicktobroadcastthevideo(bool,urls)} Clicktobroadcastthevideo={(bool,urls,index)=>this.Clicktobroadcastthevideo(bool,urls,index)}
closaoldfilesprops={this.closaoldfilesprops} closaoldfilesprops={this.closaoldfilesprops}
/> />
<style>{` <style>{`

@ -49,6 +49,9 @@ class Showoldfiles extends Component{
isaboxonClick=(item)=>{ isaboxonClick=(item)=>{
this.props.Clicktobroadcastthevideo(true,item.url+'&file_name='+item.title); this.props.Clicktobroadcastthevideo(true,item.url+'&file_name='+item.title);
} }
isaboxonClicks=(item)=>{
this.props.Clicktobroadcastthevideo(true,item.url+'?file_name='+item.title);
}
render(){ render(){
let {visible,allfiles}=this.props; let {visible,allfiles}=this.props;
@ -188,7 +191,7 @@ class Showoldfiles extends Component{
{ {
allfiles&&allfiles.content_type&&allfiles.content_type==="video/mp4"? allfiles&&allfiles.content_type&&allfiles.content_type==="video/mp4"?
<a className={"isabox"} target="_blank" onClick={()=>this.isaboxonClick(allfiles)}>{allfiles.title}</a> <a className={"isabox"} target="_blank" onClick={()=>this.isaboxonClicks(allfiles)}>{allfiles.title}</a>
: :
<a className={"isabox"} href={allfiles.url} target="_blank" >{allfiles.title}</a> <a className={"isabox"} href={allfiles.url} target="_blank" >{allfiles.title}</a>
} }

Loading…
Cancel
Save