无论如何,我可以将鼠标悬停在影片剪辑上以自动播放电影吗?

如何解决无论如何,我可以将鼠标悬停在影片剪辑上以自动播放电影吗?

| 我想在鼠标悬停时自动播放视频。 有人可以告诉我如何通过媒体播放器或Flash播放器播放吗? PS:我可以在Flash Player中播放WMV / ASF / MP4吗?     

解决方法

        好吧,我发现使用SWF文件在浏览器中显示电影是最容易的,这有两个原因:易于使用JavaScript来控制它们,并且它们可以在旧的浏览器中工作。 (很容易将任何电影格式转换为swf)。 SWF也有简单的自由度,我当时非常专心地研究了这一问题,即使我愿意花时间研究和编程,也找不到单个Flash Player可以100%控制它。 幸运的是,我有一个简单的JS框架,我使自己可以在网页中嵌入和控制电影(应该在所有浏览器中都可以使用)[注意:我对JS类的了解要比现在少。
//http://www.adobe.com/support/flash/publishexport/scriptingwithflash/scriptingwithflash_03.html

function FlashController(name)
{
    this.flashMovie = this.getFlashMovieObject(name);

    this.getXPos =        function()
                {
                    return (this.flashMovie.TGetPropertyAsNumber(\"/\",0));
                };

    this.getYPos =        function()
                {
                    return (this.flashMovie.TGetPropertyAsNumber(\"/\",1));
                };

    this.getXScale =    function()
                {
                    return (this.flashMovie.TGetPropertyAsNumber(\"/\",2));
                };

    this.getYScale =    function()
                {
                    return (this.flashMovie.TGetPropertyAsNumber(\"/\",3));
                };

    this.getNextFrame =    function()
                {
                    return (this.flashMovie.TGetPropertyAsNumber(\"/\",4));
                };

    this.getCurrentFrame =    function()
                {
                    return (this.flashMovie.TGetPropertyAsNumber(\"/\",4) - 1);
                };

    this.getTotalFrames =    function()
                {
                    return (this.flashMovie.TGetPropertyAsNumber(\"/\",5));
                };

    this.getAlpha =        function()
                {
                    return (this.flashMovie.TGetPropertyAsNumber(\"/\",6));
                };

    this.getVisibility =    function()
                {
                    return (this.flashMovie.TGetPropertyAsNumber(\"/\",7));
                };

    this.getWidth =        function()
                {
                    return (this.flashMovie.TGetPropertyAsNumber(\"/\",8));
                };

    this.getHeight =    function()
                {
                    return (this.flashMovie.TGetPropertyAsNumber(\"/\",9));
                };

    this.getRotation =    function()
                {
                    return (this.flashMovie.TGetPropertyAsNumber(\"/\",10));
                };

    this.getTarget =    function()
                {
                    return (this.flashMovie.TGetProperty(\"/\",11));
                }
    this.getFramesLoaded =    function()
                {
                    return (this.flashMovie.TGetPropertyAsNumber(\"/\",12));
                };

    this.getName =        function()
                {
                    return (this.flashMovie.TGetProperty(\"/\",13));
                };

    this.getDropTarget =    function()
                {
                    return (this.flashMovie.TGetProperty(\"/\",14));
                };

    this.getURL =        function()
                {
                    return (this.flashMovie.TGetProperty(\"/\",15));
                };

    this.getHighQuality =    function()
                {
                    return (this.flashMovie.TGetProperty(\"/\",16));
                };

    this.getFocusRect =    function()
                {
                    return (this.flashMovie.TGetProperty(\"/\",17));
                };

    this.getSoundBufTime =    function()
                {
                    return (this.flashMovie.TGetProperty(\"/\",18));
                };

    this.setXPos =        function(value)
                {
                    this.flashMovie.TSetProperty(\"/\",value);
                };

    this.setYPos =        function(value)
                {
                    this.flashMovie.TSetProperty(\"/\",1,value);
                };

    this.setXScale =    function(value)
                {
                    this.flashMovie.TSetProperty(\"/\",2,value);
                };

    this.setYScale =    function(value)
                {
                    this.flashMovie.TSetProperty(\"/\",3,value);
                };

    this.setAlpha =        function(value)
                {
                    this.flashMovie.TSetProperty(\"/\",6,value);
                };

    this.setVisibility =    function(value)
                {
                    this.flashMovie.TSetProperty(\"/\",7,value);
                };

    this.setRotation =    function(value)
                {
                    this.flashMovie.TSetProperty(\"/\",10,value);
                };

    this.setName =        function(value)
                {
                    this.flashMovie.TSetProperty(\"/\",13,value);
                };

    this.setHighQuality =    function(value)
                {
                    this.flashMovie.TSetProperty(\"/\",16,value);
                };

    this.setFocusRect =    function(value)
                {
                    this.flashMovie.TSetProperty(\"/\",17,value);
                };

    this.setSoundBufTime =    function(value)
                {
                    this.flashMovie.TSetProperty(\"/\",18,value);
                };

    this.getVariable =    function(path)
                {
                    return (this.flashMovie.GetVariable(path));
                };

    this.gotoFrame =    function(num)
                {
                    var loaded = getFramesLoaded();
                    if(num > loaded)
                    {
                        return (this.flashMovie.GoToFrame(loaded));
                    }
                    return (this.flashMovie.GoToFrame(num));
                };

    this.isPlaying =    function()
                {
                    return (this.flashMovie.IsPlaying());
                };

    this.loadMovie =    function(layerNum,url)
                {
                    return (this.flashMovie.loadMovie(layerNum,url));
                };

    this.panPixels =    function(hPx,vPx)
                {
                    this.flashMovie.Pan(hPx,vPx,0);
                };

    this.panPercent =    function(hP,vP)
                {
                    this.flashMovie.Pan(hP,vP,1);
                };

    this.getPercentLoaded =    function()
                {
                    var value = Math.round(movieControls.getFramesLoaded()/movieControls.getTotalFrames() * 100);
                    if(isNaN(value))
                    {
                        value = 0;
                    }
                    return (value);
                };

    this.play =        function()
                {
                    this.flashMovie.Play();
                };

    this.rewind =        function()
                {
                    this.flashMovie.Rewind();
                };

    this.setVariable =    function(path,value)
                {
                    this.flashMovie.setVariable(path,value);
                };

    this.zoomRect =        function(left,top,right,bottom)
                {
                    this.flashMovie.SetZoomRect(left,bottom);
                };

    this.stop =        function()
                {
                    this.flashMovie.StopPlay();
                };

    this.zoom =        function(percent)
                {
                    this.flashMovie.Zoom(percent);
                };

    this.zoomReset =    function()
                {
                    this.flashMovie.Zoom(0);
                };

    this.callFrame =    function(frame)
                {
                    this.flashMovie.TCallFrame(\"/\",frame);        
                };

    this.callLabel =    function(label)
                {
                    this.flashMovie.TCallLabel(\"/\",label);        
                };

    this.currentLabel =    function()
                {
                    return (this.flashMovie.TCallLabel(\"/\"));        
                };

    this.goToFrame =    function(num)
                {
                    this.flashMovie.TGotoFrame(\"/\",num);
                };

    this.goToLabel =    function(label)
                {
                    this.flashMovie.TGotoLabel(\"/\",label);
                };
/*
//Description: Generated as the Flash movie is downloading. The argument type is integer.
    this.OnProgress =    function(percent)
                {
                };

//Description: Generated when the ready state of the control changes.
//The possible states are:
//0=Loading,1=Uninitialized,2=Loaded,3=Interactive,4=Complete.
    this.OnReadyStateChange =    function(state)
                    {
                    };    

//Description: Generated when an FSCommand action is performed in the movie with a URL
//and the URL starts with FSCommand :
//Use this to create a response to a frame or button action in the Flash movie.
//The argument type is string.
    this.FSCommand =    function(command,args)
                {
                };*/        

    this.nextFrame =    function()
                {
                    var nextFrame = getNextFrame();
                    if(nextFrame >= getTotalFrames())
                    {
                        nextFrame = 0;
                    }

                    goToFrame(nextFrame);
                };
}

FlashController.prototype.getFlashMovieObject = function(movieName)
{
    if (window.document[movieName])
    {
        return (window.document[movieName]);
    }
    if (navigator.appName.indexOf(\"Microsoft Internet\")==-1)
    {
        if (document.embeds && document.embeds[movieName])
        {
            return (document.embeds[movieName]);
        }
    }
    else // if (navigator.appName.indexOf(\"Microsoft Internet\")!=-1)
    {
        return (document.getElementById(movieName));
    }
}

FlashController.embedVideo = function(location,name,filePath,bgColor,width,height)
{
    location.innerHTML += \'<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" \'
                + \'codebase=\"\" id=\"\' + name + \'\" width=\' + width + \' height=\' + height + \'>\'
                + \'<param name=\"movie\" value=\"\' + filePath + \'\">\'
                + \'<embed play=false swliveconnect=true name=\"\' + name + \'\" \'
                + \'src=\"\' + filePath + \'\" quality=\"high\" \'
                + \'bgcolor=\' + bgColor + \' width=\' + width + \' height=\' + height + \' type=\"application/x-shockwave-flash\">\'
                + \'</embed></object>\';

}
使用(我想已经有一段时间了):
FlashController.embedVideo(nodeToPutItIn,\"movie.swf\",fullPathToSWF,backGroundColor,height); //Or simply hard code into the webpage.
var myMovie = new FlashController(\"movie.swf\");
nodeToPutItIn.onMouseOver = \"myMovie.play();\";  //never actually done this command before so syntax might be off.
//Note: you have to wait for the movie to load if it is over a slow connection or it is big.
如果您还有其他更具体的问题,请随时提出。     ,        我终于找到了一种使用流播放器解决此问题的方法。
    <\'a\' href=\"/PlayList/myvideo.flv\" style=\"display: block; width: 520px; height: 330px\"
        id=\"player\">
    /<\'a\'>
    <!-- this will install flowplayer inside previous A- tag. -->
    <script type=\"text/javascript\">

        flowplayer(\"player\",\"flowplayer-3.2.7.swf\",{
            clip: {
                autoPlay: false,autoBuffering: true
            },onLoad: function () {   // called when player has finished loading
                this.setVolume(30); // set volume property              
            },onMouseOver: function () {

                this.play();

            },onMouseOut: function () {
                this.stop();
            }
        });

    </script>
    

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-