Skip to content

Commit

Permalink
release v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukumijima committed Aug 29, 2019
1 parent b7f5cde commit ecd53ef
Show file tree
Hide file tree
Showing 19 changed files with 354 additions and 279 deletions.
5 changes: 3 additions & 2 deletions cast/cast.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

$cc->DMP->play("http://".$argv[1].":".$http_port."/stream/stream.m3u8", "BUFFERED", "application/vnd.apple.mpegurl", true, 0);
$cc->DMP->UnMute();
$cc->DMP->pause();

// 通知
$cast = json_decode(file_get_contents(dirname(__FILE__).'/cast.json'), true);
Expand All @@ -42,7 +43,7 @@
echo ' Chromecast Play.'."\n\n";

while(true){
usleep(500);
usleep(5);
set_time_limit(0);
$cc->pingpong();
if (isset($cmd)){
Expand All @@ -69,6 +70,7 @@
// シーク
if ($cmd['cmd'] == 'seek'){
$cc->DMP->seek($cmd['arg']);
$cc->DMP->pause();
echo ' Chromecast Seek '.$cmd['arg'].'.'."\n\n";
}

Expand All @@ -92,7 +94,6 @@

// 停止(終了)
if ($cmd['cmd'] == 'stop'){
$cc->DMP->Mute();
$cc->DMP->Stop();
$cc->disconnect();
echo ' Chromecast Stop.'."\n\n";
Expand Down
2 changes: 1 addition & 1 deletion data/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.0.0
v1.0.1
1 change: 1 addition & 0 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<script type="text/javascript" src="/files/toastr.min.js"></script>
<script type="text/javascript" src="/files/push.min.js"></script>
<script type="text/javascript" src="/files/js.cookie.min.js"></script>
<script type="text/javascript" src="/files/velocity.min.js"></script>
<script type="text/javascript" src="/files/common.js"></script>
<?php
if (strpos($backtrace[0]["file"], 'index.php') !== false){ // index.phpのみ
Expand Down
4 changes: 2 additions & 2 deletions htdocs/api/searchfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
apache_setenv('no-gzip', '1');

// レスポンスをバッファに貯める
ob_start();
ob_start('mb_output_handler');

$json = array(
'apiname' => 'searchfile',
Expand Down Expand Up @@ -129,7 +129,7 @@ function duration_calc($duration){
}

// ファイルを検索
$search = array_merge(glob($TSfile_dir.'*.ts'), glob($TSfile_dir.'*\*.ts'));
$search = array_merge(glob($TSfile_dir.'/*.ts'), glob($TSfile_dir.'/*/*.ts'), glob($TSfile_dir.'/*/*/*.ts'));

foreach ($search as $key => $value) {
$TSfile['data'][$key]['file'] = $value; // パス含めたファイル名
Expand Down
179 changes: 93 additions & 86 deletions htdocs/files/common.js
Original file line number Diff line number Diff line change
@@ -1,97 +1,104 @@
$(function(){

// メニュー開閉
$('#nav-open').click(function(event){
$('#nav-close').addClass('open');
$('#nav-content').addClass('open');
$('html').addClass('open');
});
// 個人設定読み込み
$(window).on('load', function(){

$('#nav-close').click(function(event){
$('#nav-close').removeClass('open');
$('#nav-content').removeClass('open');
$('#broadcast-stream-box').removeClass('open');
$('#search-stream-box').removeClass('open');
$('#chromecast-box').removeClass('open');
$('html').removeClass('open');
});
settings = {twitter_show:true, comment_show:true, onclick_stream:false};
if (Cookies.get('settings') != undefined){
settings = JSON.parse(Cookies.get('settings'));
}

// サブメニューボタン開閉
$('#menubutton').click(function(event){
$('#menu-content').animate({height: 'toggle'}, 150);
$('#menu-content').toggleClass('open');
});

// サブメニューとサブメニューボタン以外クリックでサブメニューを引っ込める
$(document).click(function(event) {
if (!$(event.target).closest('#menubutton').length && !$(event.target).closest('#menu-content').length){
$('#menu-content').animate({height: 'hide'}, 150);
$('#menu-content').removeClass('open');
}
});
$(function(){

// パスワード開閉
$('.password-box-input').click(function(){
$('.password-box-input').toggleClass('fa-eye');
$('.password-box-input').toggleClass('fa-eye-slash');
var input = $(this).prev("input");
// type切替
if (input.attr("type") == "password") {
input.attr("type", "text");
} else {
input.attr("type", "password");
}
});
// メニュー開閉
$('#nav-open').click(function(event){
$('#nav-close').addClass('open');
$('#nav-content').addClass('open');
$('html').addClass('open');
});

// 個人設定読み込み
settings = {twitter_show:true, comment_show:true, onclick_stream:false};
if (Cookies.get('settings') != undefined){
settings = JSON.parse(Cookies.get('settings'));
}

// 上までスクロールで戻る
$(window).scroll(function() {

// スクロール位置を取得
var topPos = $(this).scrollTop();

// 表示・非表示
if (topPos > 400) {
$('#scroll').css('opacity', '1');
} else {
$('#scroll').css('opacity', '0');
}
$('#nav-close').click(function(event){
$('#nav-close').removeClass('open');
$('#nav-content').removeClass('open');
$('#broadcast-stream-box').removeClass('open');
$('#search-stream-box').removeClass('open');
$('#chromecast-box').removeClass('open');
$('html').removeClass('open');
});

});
// サブメニューボタン開閉
$('#menubutton').click(function(event){
$('#menu-content').velocity($('#menu-content').is(':visible') ? 'slideUp' : 'slideDown', 150);
$('#menu-content').toggleClass('open');
});

// 一番上まで戻る
$('#scroll').click(function(){

var topPos = $(window).scrollTop();

if (topPos > 400) {
$('html, body').animate({ scrollTop: 0 }, 700);
}
// サブメニューとサブメニューボタン以外クリックでサブメニューを引っ込める
$(document).click(function(event) {
if (!$(event.target).closest('#menubutton').length && !$(event.target).closest('#menu-content').length){
$('#menu-content').velocity('slideUp', 150);
$('#menu-content').removeClass('open');
}
});

});
// パスワード開閉
$('.password-box-input').click(function(){
$('.password-box-input').toggleClass('fa-eye');
$('.password-box-input').toggleClass('fa-eye-slash');
var input = $(this).prev("input");
// type切替
if (input.attr("type") == "password") {
input.attr("type", "text");
} else {
input.attr("type", "password");
}
});

// 上までスクロールで戻る
$(window).scroll(function() {

// スクロール位置を取得
var topPos = $(this).scrollTop();

// 表示・非表示
if (topPos > 400) {
$('#scroll').css('opacity', '1');
$('#scroll').css('visibility', 'visible');
} else {
$('#scroll').css('opacity', '0');
$('#scroll').css('visibility', 'hidden');
}

});

// 一番上まで戻る
$('#scroll').click(function(){

var topPos = $(window).scrollTop();

if (topPos > 400) {
$('html, body').velocity('scroll', { duration: 700, offset: -54 });
}

});

// トーストのオプション
toastr.options = {
"closeButton": false,
"debug": false,
"newestOnTop": false,
"progressBar": false,
"positionClass": "toast-bottom-left",
"preventDuplicates": false,
"onclick": null,
"showDuration": "200",
"hideDuration": "200",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "linear",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}

// トーストのオプション
toastr.options = {
"closeButton": false,
"debug": false,
"newestOnTop": false,
"progressBar": false,
"positionClass": "toast-bottom-left",
"preventDuplicates": false,
"onclick": null,
"showDuration": "200",
"hideDuration": "200",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "linear",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}

});
});
6 changes: 3 additions & 3 deletions htdocs/files/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// コメントを取得してコメント一覧画面にコメントを流し込む
// スマホ以外のみ発動(スマホだと動作が遅くなるため)
if ($(window).width() > 768){
if (document.body.clientWidth > 768){

// コメント一覧の時間欄のwidthを調整
$('#comment-time').css('width', '62px');
Expand Down Expand Up @@ -32,7 +32,7 @@
}

// コメントを一気にコメント一覧に挿入
// 1つずつだと遅すぎるため一気に、さらにスピード重視であえてJavaScriptで実装しています
// 1つずつだと遅すぎるため一気に、さらにスピード重視であえてJavaScriptで実装
document.getElementById('comment-draw-box').innerHTML = html;

}
Expand All @@ -57,7 +57,7 @@
// progressbarの割合を計算して代入
var video = $('.dplayer-video-current').get(0);
var percent = (video.currentTime / video.duration) * 100;
$('#progress').width(percent + '%');
document.getElementById('progress').style.width = percent + '%';
});

});
Loading

0 comments on commit ecd53ef

Please sign in to comment.