播放YouTube视频vb.net网站的列表(Play a list of youtube videos vb.net Web)

编程入门 行业动态 更新时间:2024-10-07 01:27:48
播放YouTube视频vb.net网站的列表(Play a list of youtube videos vb.net Web)

假设我有一个YouTube视频列表

https://www.youtube.com/watch?v=stYNW4ub5mk https://www.youtube.com/watch?v=Zvjmt4pwtdg ..... .....

我怎样才能一一播放他们,然后重复,例如

for j= 1 to 999999999 for i = 0 to n '(where n is number of videos) 'play video i 'how can I tell the ith one ended and to play the next one? next i next j

我在自己的网页上使用什么控制语法播放视频(全尺寸)?

谢谢

Say I have a list of youtube videos

https://www.youtube.com/watch?v=stYNW4ub5mk https://www.youtube.com/watch?v=Zvjmt4pwtdg ..... .....

How can I play them one by one and then repeat, eg

for j= 1 to 999999999 for i = 0 to n '(where n is number of videos) 'play video i 'how can I tell the ith one ended and to play the next one? next i next j

What control, syntax do I use to play the video in my own web page (full size)?

thanks

最满意答案

使用YouTube播放器API。 (youtube.com/player_api)它处理与嵌入的YouTube视频的交互。 要检测视频何时结束,请检查onPlayerStateChange事件。 你可以添加一个脚本部分到你的html并包含这个:

编辑 :event.data === 1是播放器启动时,无论是单击还是自动启动event.data === 0是视频完成时。

function onPlayerStateChange(event) { if(event.data === 1) { #doSomething } if(event.data === 0) { #callMethodToIncrementVideo } }

Use the YouTube player API. (youtube.com/player_api) It handles interactions with embedded YouTube videos. To detect when a video ends, check for the onPlayerStateChange event. You can add a script section to your html and include this:

edit: event.data === 1 is when the player starts, either when it is clicked or if it automatically starts event.data === 0 is when the video is done.

function onPlayerStateChange(event) { if(event.data === 1) { #doSomething } if(event.data === 0) { #callMethodToIncrementVideo } }

更多推荐

本文发布于:2023-08-07 18:21:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1465260.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:列表   网站   视频   vb   net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!