将带有实时控件的视频嵌入到交互式闪亮环境中 [英] Embed Video with Live Controls into Interactive Shiny Environment

查看:23
本文介绍了将带有实时控件的视频嵌入到交互式闪亮环境中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种使用 R Studio 中的 Shiny 包执行以下操作的方法:

  • 提示用户从主窗口内的计算机中选择视频文件
  • 视频文件然后在带有控件(播放、暂停等)的主窗口中打开

我见过讨论如何从网站嵌入视频的帖子,但我从未见过讨论如何从计算机中选择视频文件,然后在主窗口中使用实时控件打开它们的帖子.

感谢您的帮助!

解决方案

添加视频非常容易.为此,请按照以下方式构建您的应用:

server.r

图书馆(闪亮)闪亮服务器(功能(输入,输出,会话){})

ui.r

shinyUI(流体页面(tags$video(id="video2", type = "video/mp4",src = "SampleVideo_1280x720_1mb.mp4", controls = "controls")))

www - 这是您的视频所在的位置,这里有 .mp4 格式的视频,从

I'm looking for a way to do the following using the Shiny package in R Studio:

  • Prompt user to select video file from the computer inside main window
  • Video file then opens in main window with controls (play, pause, etc.)

I've seen posts that discuss how to embed videos from websites, but I've never seen a post discuss how to select video files from your computer AND then open them with live controls within the main window.

Thanks for your help!

解决方案

Its quite easy to add a video. To do so please structure your app like so:

server.r

library(shiny)
shinyServer(function(input, output, session) {})

ui.r

shinyUI(
  fluidPage(
    tags$video(id="video2", type = "video/mp4",src = "SampleVideo_1280x720_1mb.mp4", controls = "controls")
  )
)

www - this is where your video is, here I have .mp4 format video, downloaded from http://www.sample-videos.com/

这篇关于将带有实时控件的视频嵌入到交互式闪亮环境中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆