|
 |
|
ขอความช่วยเหลือจะ insert ข้อมูลจากการใช้ flowplayer ครับ |
|
 |
|
|
 |
 |
|
พอดีผมใช้ flowplayer วนลูปเล่นไฟล์วีดีโอ แล้วอยากให้มีการบันทึกชื่อไฟล์ วันที่เล่น และเวลาที่เล่นลงไปในฐานข้อมูลครับ
ผมต้อง insert อย่างไรเข้าไปเก็บไว้ครับ ที่ทดลองทำมันจะเก็บได้แค่ไฟล์ตัวแรกตัวเดียวน่ะครับ วีดีโอที่2ไปจะเก็บไม่ได้
และจะวนกลับมาเก็บค่าได้อีกเมื่อกลับมาเล่นตัวแรกน่ะครับ
อันนี้เป็น code ที่ใช้นะครับ
Code (PHP)
<?php
include('../walldigital/include/ez_sql.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<?php
$_GET['pid'] =1 ;
if($_GET['pid'] ){
$sql_select_playlista = "select * from playlist where p_playlist_name = '".$_GET['pid']."'order by p_Order ";
$arr_select_playlista = $db->get_results($sql_select_playlista);
if($arr_select_playlista){
$ca = 1 ;
$work_date = @date('Y/m/d');
$work_time = @date('H:i:s');
foreach($arr_select_playlista as $value_playlist){
//// Insert Mysql ////////
$sql_report = "insert into report ( r_name, r_date, r_time ) values ( '".trim($value_playlist->m_name)."' , '".$work_date."' , '".$work_time."' )";
$db->query($sql_report);
////////////////////////
if($ca == 1){ $fisleplay = trim($value_playlist->m_name) ; }
$arrplay .= '
soundd['.$ca.'] = "'.trim($value_playlist->m_name).'"; ';
$ca ++ ;
}
}}
?>
<?
?>
<script type="text/javascript">
var req;
function startCallback(){
if(req.readyState == 4){
if(req.status == 200){
setTimeout("doStart()",1000);
}
}
}
function doStart(){
req = Inint_AJAX();
var url = "player.php";
req.open("GET", url, true);
req.onreadystartchange = startCallback;
req.send(null);
};
</script>
<script type="text/javascript" src="../walldigital/mediaplayer/flowplayer-3.2.13.min.js"></script>
<body onload="doStart();">
<div id="player" style="width:800px; height:550px; position:absolute; top:0; left:0;"></div>
</body>
<script type="text/javascript">
var soundd = [];
<?
echo $arrplay ;
?>
var ordersound = 1 ;
flowplayer("player", "../walldigital/mediaplayer/flowplayer.unlimited-3.2.18.swf", {
playlist: [ './media/New Ads/'+soundd[ordersound] ],
autoPlay: true,
autoBuffering: true,
play:{
opacity: 0.0,
label: null, // label text; by default there is no text
replayLabel: null // label text at end of video clip
},
onBeforeFinish: function(playlist) {
ordersound = (ordersound+1);
if(ordersound != <? echo $ca; ?>){
$f(0).play( './media/New Ads/'+soundd[ordersound]);
}else{
location.reload(true);
}
},
loop: true,
plugins: { controls: null }
});
</script>
</html>
Tag : PHP, HTML/CSS, JavaScript, Ajax, jQuery

|
|
 |
 |
 |
 |
Date :
2016-04-06 20:59:32 |
By :
serpens |
View :
919 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
การลอกเป็นบ่เกิดของความต...
ยากแก้ไข ใส่(เปลี่ยน)สถานะของไฟล์ที่เล่นก่อน
|
 |
 |
 |
 |
Date :
2020-07-01 18:46:17 |
By :
PhrayaDev |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|