Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Video Highcharts系列数据选择点视频同步_Video_Highcharts_Synchronization_Series - Fatal编程技术网

Video Highcharts系列数据选择点视频同步

Video Highcharts系列数据选择点视频同步,video,highcharts,synchronization,series,Video,Highcharts,Synchronization,Series,我需要一些帮助同步视频时间线与曲线系列的数据选择点。 为了更好地解释我想做什么以及我到目前为止做了什么,请看 我需要选定的点停止闪烁。我需要更流畅的运动。 我尝试了一些技巧,但没有成功 欢迎任何帮助 var video = document.getElementById("Video"); $(function () { $('#container').highcharts({ chart: { type: 'spline',

我需要一些帮助同步视频时间线与曲线系列的数据选择点。 为了更好地解释我想做什么以及我到目前为止做了什么,请看

我需要选定的点停止闪烁。我需要更流畅的运动。 我尝试了一些技巧,但没有成功

欢迎任何帮助

var video = document.getElementById("Video");

$(function () {
    $('#container').highcharts({
        chart: {
            type: 'spline',
            margin: [0, 0, 0, 0]
        },
        title: {
            text: ''
        },
        legend: {
            enabled: false
        },
        credits: {
            enabled: false
        },
        exporting: {
            enabled: false
        },
        subtitle: {
            text: ''
        },
        xAxis: {
            lineWidth: 0,
            minorGridLineWidth: 0,
            lineColor: 'transparent',
            minorTickLength: 0,
            tickLength: 0,
            text: null,
            labels: {
                enabled: false
            }
        },
        yAxis: {
            title: {
                text: null
            },
            max: 100,
            min: 0,
            minorGridLineWidth: 0,
            gridLineWidth: 0,
            alternateGridColor: null,
            labels: {
                enabled: false
            },
            plotLines: [{
                value: 70.345255,
                color: '#62acdf',
                dashStyle: 'dot',
                width: 1
            }, {
                value: 29.654745,
                color: '#62acdf',
                dashStyle: 'dot',
                width: 1
            }],
            plotBands: [{
                from: 29.654745,
                to: 70.345255,
                color: 'rgba(98,172,223,0.1)'
            }]
        },
        tooltip: {
            formatter: function () {
                return this.x / 2 + 's<br>' + '<span style="color:' + this.series.color + '">●</span> ' + this.series.name + ': <b> ' + this.y.toFixed(2) + '</b>';
            }
        },
        plotOptions: {
            series: {
                allowPointSelect: true,
                point: {
                    events: {
                        click: function () {
                            video.currentTime = (this.x / 2);
                            video.pause();
                        }
                    }
                },
                marker: {
                    radius: 1,
                    states: {
                        select: {
                            radius: 3,
                            fillColor: '#62acdf',
                            lineColor: '#62acdf',
                            lineWidth: 4
                        }
                    }
                }
            },
            spline: {
                lineWidth: 2,
                states: {
                    hover: {
                        lineWidth: 2
                    }
                },
                marker: {
                    enabled: true
                }
            }
        },
        series: [{
            name: 'txt',
            color: '#62acdf',
            data: [{
                y: 30.866000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 42.868000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 46.859000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 51.062000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 68.203000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 56.879000,
                color: '#BF0B23',
                radius: 0
            },
            72.250000, {
                y: 35.184000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 66.606000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 34.417000,
                color: '#BF0B23',
                radius: 0
            },
            19.729000, 22.328000, 26.512000, 8.023900, 23.775000, 19.330000, 18.326000, {
                y: 43.427000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 37.062000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 49.789000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 42.211000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 50.581000,
                color: '#BF0B23',
                radius: 0
            },
            16.836000, 14.436000, 9.622700, 6.944100, 28.147000, 16.000000, {
                y: 45.813000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 48.373000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 64.385000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 42.571000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 65.816000,
                color: '#BF0B23',
                radius: 0
            },
            10.839000, 21.495000, {
                y: 47.478000,
                color: '#BF0B23',
                radius: 0
            },
            10.273000, 29.029000, 21.656000, 15.887000, 15.531000, {
                y: 55.848000,
                color: '#BF0B23',
                radius: 0
            },
            70.714000, {
                y: 50.479000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 64.778000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 67.984000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 60.161000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 32.788000,
                color: '#BF0B23',
                radius: 0
            },
            27.038000, {
                y: 30.471000,
                color: '#BF0B23',
                radius: 0
            },
            27.768000, {
                y: 34.068000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 43.744000,
                color: '#BF0B23',
                radius: 0
            },
            72.629000, {
                y: 52.510000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 55.916000,
                color: '#BF0B23',
                radius: 0
            }, {
                y: 64.293000,
                color: '#BF0B23',
                radius: 0
            },
            74.891000, {
                y: 48.053000,
                color: '#BF0B23',
                radius: 0
            },
            22.576000, {
                y: 50.433000,
                color: '#BF0B23',
                radius: 0
            }, ]
        }],
        navigation: {
            menuItemStyle: {
                fontSize: '10px'
            }
        }
    });
});
var curves = $('#container').highcharts();
video.addEventListener("timeupdate", function () {
    var percent = (this.currentTime / this.duration);
    var posicao = (percent * curves.series[0].data.length).toFixed(0);
    curves.series[0].data[posicao].select();

}, false);

在我看来,你的视频。addEventListener启动太多了。这会导致闪烁,因为它会一次又一次地选择同一点。也许可以检查一下posicao是否与上次运行时不同,是否只是退出。如果不同,则进行选择。

您可以使用事件“seek”同步变量。
当用户单击时间轴时,当视频实际转到用户单击的帧时,将触发此事件。然后,您应该将posicao与保持最后一个已知位置的变量同步。

我以前尝试过,但当单击视频的时间线时,我总是丢失最后一个位置。我错过了一些东西。我终于得到了我需要的东西。检查我的最终代码。谢谢