videojs / video.js

Video.js - open source HTML5 video player
https://videojs.com
Other
37.87k stars 7.43k forks source link

getting error "TypeError: this.el_[prop] is not a function" #4694

Closed ankmachine closed 6 years ago

ankmachine commented 6 years ago

Description

I am using kockoutjs with videojs. The moment i click on the play button it gives me error in browser(chrome) console :

VIDEOJS: Video.js: play unavailable on Html5 playback technology element. TypeError: this.el_[prop] is not a function at Html5.(anonymous function) [as play]

there is jsfiddle for same https://jsfiddle.net/u0uL3hwf/3/

Steps to reproduce

In chrome browser https://jsfiddle.net/u0uL3hwf/3/

Results

Expected

to play the nice video i have provided as source

Actual

its not playing anything with the error in browser console.

Error output

VIDEOJS: Video.js: play unavailable on Html5 playback technology element. TypeError: this.el_[prop] is not a function at Html5.(anonymous function) [as play]

Additional Information

I am using kockoutjs with videojs

versions

videojs

6.2.8 (its happening with other versions too, like 5.8.8)

browsers

chrome

OSes

centOS7

plugins

In my main project I am using hotkey, but jsfiddle is without any plugin

kocoten1992 commented 6 years ago

the div tag, change it to video tag, it will work

ankmachine commented 6 years ago

thanks, that worked, i wonder why videojs worked with div tag where i was not using knockoutjs?

gkatsev commented 6 years ago

That's weird. Maybe you had the video tag wrapped in a div instead? Anyway, I have a PR open to not require you to use a video tag directly but rather use a video-js element (which is basically a div): #4640

Closing since seems like it's fixed :). Thanks @kocoten1992 for helping out!