Skip to content

Commit

Permalink
merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
phobal committed May 5, 2018
2 parents 49eaaee + cf30af7 commit 4845e60
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* 2018.5.5

修改页面样式,当全屏时隐藏掉左侧菜单栏和顶部接口切换栏
2 changes: 1 addition & 1 deletion app/containers/ToolBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const ToolBar = ({ onComeback, onSwitchSource, onSourceSelected, freeUrl, title
return (
<div style={{ display: 'flex', height: '100%', alignItems: 'center', justifyContent: 'space-between', padding: '0 20px' }}>
<div type="rollback" style={{ fontSize: '18px', cursor: 'pointer' }} onClick={onComeback}>返回</div>
<span>{title}</span>
<span style={{ padding: '0 20px', color: 'darkcyan' }}>{title}</span>
<div
style={{ display: 'flex', alignItems: 'center' }}
>
Expand Down
19 changes: 13 additions & 6 deletions app/containers/Video.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import React, { PureComponent } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { webview } from 'electron';
import { webview, ipcRenderer } from 'electron';

import Channel from './Channel';
import ToolBar from './ToolBar';
Expand All @@ -21,6 +21,7 @@ class VideoPlay extends PureComponent < Props > {
url: 'https://v.qq.com',
freeUrl: [],
selectedUrl: 'http://vip.jlsprh.com/index.php?url=',
isFullScreen: false,
}
componentDidMount() {
this.props.actions.getAllVideoSource();
Expand All @@ -39,6 +40,11 @@ class VideoPlay extends PureComponent < Props > {
url: `${obj.url}`
});
});
ipcRenderer.on('enter-full-screen', (e, msg) => {
this.setState({
isFullScreen: msg
});
});
}
componentWillReceiveProps(nextProps) {
const { source } = nextProps;
Expand Down Expand Up @@ -81,17 +87,18 @@ class VideoPlay extends PureComponent < Props > {
});
}
render() {
const { channel, url, freeUrl, title } = this.state;
const { channel, url, freeUrl, title, isFullScreen } = this.state;
const isHiddenStyle = isFullScreen ? { display: 'none'} : { display: 'flex'};
return (
<div style={{ display: 'flex' }}>
<div style={{ width: '200px' }}>
<div style={{ minWidth: '150px', ...isHiddenStyle }}>
<Channel
channel={channel}
handleSwitchChannel={this.handleSwitchChannel}
/>
</div>
<div style={{ height: '100vh', width: 'calc(100vw - 200px)', display: 'flex', flexDirection: 'column' }}>
<div style={{ height: '60px' }}>
<div style={{ height: '100vh', width: isFullScreen ? '100vw' : 'calc(100vw - 150px)', display: 'flex', flexDirection: 'column' }}>
<div style={{ height: '60px', ...isHiddenStyle }}>
<ToolBar
onComeback={this.onComeback}
onSourceSelected={this.onSourceSelected}
Expand All @@ -103,7 +110,7 @@ class VideoPlay extends PureComponent < Props > {
<webview
ref={ (webview) => {this.webview = webview} }
title="腾讯视频"
style={{ height: 'calc(100vh - 60px)', width: '100%' }}
style={{ height: isFullScreen ? '100vh' : 'calc(100vh - 60px)', width: '100%' }}
src={url}
allowpopups="true"
>
Expand Down
8 changes: 7 additions & 1 deletion app/main.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @flow
*/
import { app, BrowserWindow } from 'electron';
import { app, BrowserWindow, ipcMain} from 'electron';
import MenuBuilder from './menu';

let mainWindow = null;
Expand Down Expand Up @@ -81,6 +81,12 @@ app.on('ready', async () => {
mainWindow = null;
});

mainWindow.on('enter-full-screen', () => {
mainWindow.webContents.send('enter-full-screen', true);
})
mainWindow.on('leave-full-screen', () => {
mainWindow.webContents.send('enter-full-screen', false);
})
const menuBuilder = new MenuBuilder(mainWindow);
menuBuilder.buildMenu();
});
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ivideo",
"productName": "ivideo",
"version": "1.0.1",
"version": "1.1.0",
"description": "一个视频播放器观看国内主流视频网站,不用单独下载各个平台客户端",
"scripts": {
"build": "concurrently \"npm run build-main\" \"npm run build-renderer\"",
Expand Down

0 comments on commit 4845e60

Please sign in to comment.